aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Question Regarding HFE / Bean things you can do within business methods - Page 199 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Question Regarding HFE / Bean things you can do within business methods - Page 199" Watch "Question Regarding HFE / Bean things you can do within business methods - Page 199" New topic
Author

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

mini mehta
Ranch Hand

Joined: Oct 22, 2000
Posts: 120
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
Santosh Ramachandrula
Ranch Hand

Joined: Apr 04, 2004
Posts: 252
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 ]

Thanks,
Santosh
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
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.


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
mini mehta
Ranch Hand

Joined: Oct 22, 2000
Posts: 120
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

Joined: Sep 29, 2002
Posts: 1683
Both session beans and message-driven beans can use CMT or BMT, but entity beans can only use CMT.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question Regarding HFE / Bean things you can do within business methods - Page 199