[jboss-dev-forums] [JBoss Transactions Development] - Re: EnityManager.close() before or after JTA afterCompletion()?

Tom Jenkinson do-not-reply at jboss.com
Mon Feb 4 12:14:02 EST 2013


Tom Jenkinson [https://community.jboss.org/people/tomjenkinson] created the discussion

"Re: EnityManager.close() before or after JTA afterCompletion()?"

To view the discussion, visit: https://community.jboss.org/message/795988#795988

--------------------------------------------------------------
Hi Seyvet,

If you look at those two stack traces you can see a common line:

at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.afterCompletion(TwoPhaseCoordinator.java:402)

The only ordering that can be guaranteed is for interposed synchronizations (registered by the TransactionSynchronizationRegistry):
 http://docs.oracle.com/javaee/5/api/javax/transaction/TransactionSynchronizationRegistry.html#registerInterposedSynchronization%28javax.transaction.Synchronization%29 http://docs.oracle.com/javaee/5/api/javax/transaction/TransactionSynchronizationRegistry.html#registerInterposedSynchronization%28javax.transaction.Synchronization%29

There was a little mistype in my original response which I will now refactor in the original to say:

...
foreach ResourceManager
   rm::commit()
foreach InterposedSynchronization
   s::beforeCompletion();
foreach Synchronization
   s::afterCompletion();

i.e. When it comes to afterCompletion, interposed synchronizations will be called *first* which is one way (if you only have two synchronizations  ;)  ) to guarentee order.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/795988#795988]

Start a new discussion in JBoss Transactions Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2041]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20130204/e1fec2d0/attachment.html 


More information about the jboss-dev-forums mailing list