my dog learned polymorphism
The moose likes EJB and other Java EE Technologies and the fly likes Bean managed transaction for MDB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Bean managed transaction for MDB" Watch "Bean managed transaction for MDB" New topic

Bean managed transaction for MDB

trupti nigam
Ranch Hand

Joined: Jun 21, 2001
Posts: 613
Hello all,

I am using Bean managed transaction for the MDB. Does that mean that I can use Transaction.Begin() and Transaction.rollback() in my code?

Dushy Inguva
Ranch Hand

Joined: Jun 24, 2003
Posts: 264

Yes. You have to invoke the begin() and commit() but, using CMT would make your life a lot more easier unless you have a very good reason not to do so.

BMT makes shooting yourself in the foot really easy :-)

Balamaci Serban
Ranch Hand

Joined: Mar 16, 2005
Posts: 49
And more, be aware that MDB with BMT does not have any effect on message redelivery, while in using a MDB with CMT does, if calling a setRollbackOnly() on the MessageDrivenContext.
I agree. Here's the link:
subject: Bean managed transaction for MDB
It's not a secret anymore!