This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have a stateless session bean, with bean managed transaction.
the code is like this...
method1(); //in this i am updating few table in DB -DB connection is taken in the same method and closed there
method2(); // calling a stored procedure to do smthing etc
method3(); //update smthing else
Are these methods doing their own BMT also? If so, that would be the cause of the problem. BMT transactions do not join existing transactions. Also, what is the need for BMT at all?
Hope it helps,
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
Joined: Mar 13, 2009
Its' not rollbacking anything at all.
Is there any problem in using BMT???
Joined: Feb 01, 2005
As I mentioned, BMT transactions do not participate in any existing transactional contexts (we talk about this in the book). If you are using BMT in *all* your methods, there would not be a "global" rollback. Also, BMT should be used only when CMT is not sufficient. Again, we talk about this in the book. Whatever reference you are using should be doing the same, so I would take a look there first.