Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning 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
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

CMP & BMT

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a question about transaction. For component-managed persistance session beans and MDBs, can they use bean managed transaction? Are they contradict?
Thanks in advance!
 
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any session or MDBs can use either container managed transaction (CMT) demarcation or BMT . 2.0 Entity beans must use only CMT.
Persistence has nothing to do with transactions, these are totally different areas.
Only the implementation has some kind of similarity. Both CMP and CMT are used thru deployment descriptor elements, whereas BMP uses progarmming thru JDBC and BMT uses programming thru javax.transaction APIs.
Thanks, Sudd
 
XueRong Weng
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for clarifying the concept. I'm much clearer now.
I have one more question. On my book, it is stated BMT beans must not use the setRollbackOnly() and getRollbackOnly. What's the reason behind?
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BMT beans (only session and MDB) call setRollbackOnly() and getStatus() method on the javax.transaction.UserTransaction, which you get from calling javax.ejb.EJBContext.getUserTransaction() method.
BTM bean will get IllegalStateException if it invokes setRollbackOnly() or getRollbackOnly() directly on EJBContext.
Hope this helps.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic