Saturday, December 22, 2007

XA Two Phase Transactions doesn't work

When you use XA or in it's second name Two Phase Commit Transaction and the transaction doesn't work it can be cause by one of the following reasons:

  • You didn't declare transaction manager in your application server or in your spring XML configuration file
  • You declared transaction manager but no annotation was defined for the EJB or the annotation was defined NOT_SUPPORTED
  • There is annotation but if you call from some method in the EJB to another method in the same EJB the second method can't open transaction since it is a local call which doesn't execute through the j2ee engine interpreter and therefore not transaction is opened. A Possible solution for that is to use UserTransaction and open the transaction pragmatically or to move the second method to another EJB.

No comments:

Links

 
RSS Feeds Submission Directory