• 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:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic