• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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.
 
What is that? Is that a mongol hoarde? Can we fend them off with this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic