• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CMT vs BMT

 
Omis Hein
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to understand why a Stateful session bean with BMT, may
access SessionContext.getUserTransaction() in its ejbCreate/ejbRemove/ejbActivate and ejbPassivate methods.
But a CMT Stateful session bean may NOT access SessionContext.getRollbackOnly()/SessionContext.setRollbackOnly() in these same methods.
Thanks.
 
Ben Dover
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Omis Hein:
I am trying to understand why a Stateful session bean with BMT, may
access SessionContext.getUserTransaction() in its ejbCreate/ejbRemove/ejbActivate and ejbPassivate methods.
But a CMT Stateful session bean may NOT access SessionContext.getRollbackOnly()/SessionContext.setRollbackOnly() in these same methods.
Thanks.

If you declare your bean to use CMT, then it's all or nothing, you can't suddenly use the container's transaction bits because the container is now responsible for the transaction processing. In other words, why use CMT if you want to make BMT style calls? Hello? If you use BMT however, the container is hands-off (karate pose) and you can fiddle with its transaction calls. Make sense?
Probably more to it but there's a start.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic