-
1. Re: Listener for CMT commit/rollback
guidoscalise Feb 14, 2008 8:38 AM (in response to koh)If you only need some kind of callback to confirm transaction commitment, you could send a JMS Message (using a XA JMS Connector) to a topic subscribed by a Message Driven Bean.
This will provide you an asynchronous callback, not coupled nor dependant on the original, commited transaction.
Regards,
Guido -
2. Re: Listener for CMT commit/rollback
guidoscalise Feb 14, 2008 11:35 AM (in response to koh)You can also enlist an object implementing XAResource in the running transaction using transactionManager.getTransaction().enlistResource(XAResource) then in the commit method you "do your magic".
I think it's a risky alternative if you need to do any transactional/complex logic. In that case, the preferred method is the JMS/MDB one, as it ensures that the resulting action is triggered asynchronously and decoupled from the original transaction.
It would be great to have some "enlightenment" on this issues from the JBossTM dev-team.
Regards,
Guido