• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setting rollbacks for BMT and CMT?

 
yamini nadella
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJBContext.setRollbackOnly() for CMT is similar to UserTrasaction.setRollbackOnly for BMT.

is it correct?
 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by yamini nadella:
EJBContext.setRollbackOnly() for CMT is similar to UserTrasaction.setRollbackOnly for BMT.

is it correct?


It's exactly the same. The specs had to grant the bean provider the possibility to mark a transaction for rollback, even if the bean provider opted for BMT.

To check whether a transaction has been marked for rollback, however, things are different:

With CMT, users will use EJBContext.getRollbackOnly()

With BMT, users will use UserTransaction.getStatus()
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic