Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Bean managed transaction for MDB

 
trupti nigam
Ranch Hand
Posts: 627
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

Thanks,
trupti
 
Dushy Inguva
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Trupti,

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
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic