-
1. Re: Synchronization jta
mmusgrov Apr 25, 2012 10:39 AM (in response to rakhaoui)It defined in the javax.transaction.Transaction interface.
You get the current transaction from the transaction manager via javax.TransactionManager.getTransaction
You get the transaction manager via JNDI lookup.
As far as I'm aware the JTA spec does not mandate that the TM is exposed in this way but if it is then it does not mandate what JNDI name should be used.
So you need to check the documentation for whichever JEE server you are using, for example AS7 registers it as java:jboss/TransactionManager.
-
2. Re: Synchronization jta
rakhaoui Apr 25, 2012 11:27 AM (in response to mmusgrov)thank you for your response,
i found TransactionManager.registerSynchronization method
TransactionManager utx1 =
(TransactionManager) new InitialContext().lookup("java:/TransactionManager
);utx1.begin();
utx1.getTransaction().registerSynchronization(
new
MyUserTransactionListener());