I got one problem in my application, that is the transaction is not maintaining between two EJB's.
Example : Take two EJB's A and B. In A ejb i started one transaction and this ejb is calling another ejb B. In this B ejb, the new transaction is starting and commiting and then coming back to the A and remaining code is executing.
But the problem is, suppose if i get any exception in the end of the A ejb(that is B ejb execution completed) then in the Database operations in the ejb B are not rolledback. only the database operations in A are rollback.
So how can i maintain the trasaction between the two EJB's (A and B). Is it possible to maintain the transaction between two EJB's ??? Please give me solution for this
If you use the "Required" transaction attribute then the same transaction context will propogate from EJB A to EJB B. I am not sure about BMT, but I guess you have to get the user transaction in EJB A and do an explicit rollback in case of an Exception.