This content has been marked as final.
Show 3 replies
-
1. Re: Converting work done in local jms transaction into xa tr
adrian.brock Mar 20, 2006 6:31 AM (in response to timfox)"timfox" wrote:
I'm guessing this might be something to do with message delivery to message listeners where we want the deliveried message to be in the context of the xa tx, but the user can't start work in the xa tx until the onMessage method is executed by which time it would be too late. Hence any work done is converted.
Correct. It is for the ConnectionConsumer/ServerSessionPool.
If it tried to start the JTA transaction first, the transaction would timeout
waiting for a non-existant message. -
2. Re: Converting work done in local jms transaction into xa tr
timfox Mar 20, 2006 6:54 AM (in response to timfox)Make sense.
Also, if someone wasn't using ConnectonConsumer stuff, but was using an XAConnection to create an XASession directly, then consuming messages via a message listener in that session, they're also going to get this conversion behaviour:
e.gpublic void onMessage(Message m) { //start causes delivery of the message to be converted into the tx xaResource.start(xid, XAResource.TMNOFLAGS); //do something xaResource.end(xid, XAResource.TMSUCCESS); xaResource.prepare(xid); xaResource.commit(xid, false); }
I can't really see any problems in having this behaviour, but is it correct in this case?
I guess if the spec is silent on this, it should be ok... -
3. Re: Converting work done in local jms transaction into xa tr
adrian.brock Mar 20, 2006 7:01 AM (in response to timfox)I can't see any other way of making XA work with a message listener.
Short of having a temporary message listener that doesn't receive
for very long.