Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

CMT vs BMT

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
knowledge is the difference between drudgery and strategic action -- tiny ad
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic