Win a copy of Pipeline as Code this week in the Cloud/Virtualization 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Question Regarding HFE / Bean things you can do within business methods - Page 199

 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Can anybody please explain page 199 of HFE to me. The doubts I have is: how can business methods in Session bean can do the following
1. force a transaction to rollback(CMT beans)
2. find out if the transaction already been set to rollback (CMT beans).
As both of the above relates to CMT beans, It shouldn't be allowed from Session beans. I think CMT is only for Entity beans.
Can somebody please explain.
Regards
Mini
 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can specify transactions by methods also. So if you specify a transaction attribute for a method in Session Bean then it is CMT.
Session and Entity differ in handling Persistance
[ April 10, 2004: Message edited by: Santosh Ram ]
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All type of beans can participate in transactions. The interface javax.ejb.EJBContext declares the methods setRollbackOnly() and getRollbackOnly() to force a transaction to rollback and to test if the transaction has been marked for rollback respectively.
 
mini mehta
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
You guys mean, it is only the CMP or BMP which is related to Entity beans, but CMT or BMT relates to both Session and Entity beans?
Thanks
Mini
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Both session beans and message-driven beans can use CMT or BMT, but entity beans can only use CMT.
 
Why fit in when you were born to stand out? - Seuss. Tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic