• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Bean things that can be done in BMT Vs CMT

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much. Things are now clear to me.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic