• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Bean things that can be done in BMT Vs CMT

 
Srinivas Modekurti
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a little curious to know about the bean things that we can do in BMT and CMT demarcations for a stateful session bean.

The thing which is confusing to me is that for a BMT on a stateful session bean, I cannot do sessionCtx.geRollbackonly() andsetRollbackOnly inside an ejbCreate() method. Whereas if I use BMT, I am allowed to get an UserTransaction and call methods on it like getRollbackOnly() in the same ejbCreate() method.

Would appreciate if anyone can throw some light on it....
 
Vagner Freitas
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Srinivas,

CMT session bean method ejbCreate() is not considered part of client's transaction, then it run in an "unspecified transaction context". Becouse this, the nethods EJBContext.setRollbackOnly() and EJBContext.getRollbackOnly() can't be called in ejbCreate().
But for BMT session bean the bean provider manages the transaction, and then it is possible get UserTransaction and call methods on it in ejbCreate(), like begin(), commit(), getStatus(), rollback(), setRollbackOnly() and setTransactionTimeout().
I hope this helps you.

Vagner
 
Srinivas Modekurti
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much. Things are now clear to me.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic