[jboss-dev-forums] [Design of JCA on JBoss] - Re: XAExpectionUnitTestCase Failures/JBossTS/JBoss 4.2

adrian@jboss.org do-not-reply at jboss.com
Fri Jan 26 07:45:53 EST 2007


No.
<track-connection-by-tx/>
is there to disable transaction interleaving.
It is only relevant for XA, it must be true for local.

There has been some debate in the past on whether we should disable
interleaving by default since most XAResources don't support it.
This includes all xa datasources that I've come across which is why
their examples disable it.

e.g. possible change
1) Disable interleaving by default
2) Ignore the track-connection-by-tx
3) Add a new flag <interleaving/>

JBossMQ supports transaction interleaving, meaning the pool
does not have to be as big as for other JMS impls! See below.

Explanation of transaction interleaving:

The purpose of interleaving is to improve the performance of the pool.

If the XAResource supports interleaving then multiple transactions can
go through it at once (although only one transaction can be associated at once).

e.g. Using a single real connection/XAResource

Tx1: Ask for a connection and enlist the xa resource 
XAResource.start(xid1, TMNOFLAGS)

Tx1: Return the connection to the pool 
XAResource.end(xid1, TMSUSPEND)

Tx2: Ask for a connection and enlist the xa resource (it is the same) - XAResource.start(xid2, TMNOFLAGS)

(Point A)

Tx2: Return the connection to the pool
XAResource.end(xid2, TMSUSPEND)

Tx1: Ask for a connection and enlist the xa resource - we resume the old one
XAResource.start(xid1, TMRESUME)

Additionally, the XAResource 2PC commtt protocol can be invoked
concurrently if the XAResource supports interleaving.

i.e. in the above at (Point A) the Tx1/xid1 could be committed even
though the XAResource is currently associated with xid2

As you can see. Support for interleaving greatly reduces the number
of connections required in the pool. 
If you have transaction stickiness (track-connection-by-tx),
you need one connection per transaction, even if the transaction
has already tried to return the connection to the pool, but it hasn't committed it yet.

Example of where interleaving is useful:

1) get jms connection and receive a message
2) return jms connection for somebody else to use
3) do long running process (might take minutes)
4) commit

With track-connection-by-tx, the connection won't become available
until after the long running process is complete, with interleaving
somebody else can use the connection during the long running process.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006779#4006779

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006779



More information about the jboss-dev-forums mailing list