• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

CMT vs BMT

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic