File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Doubt in access of tx stuff in stateless and stateful bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Doubt in access of tx stuff in stateless and stateful bean" Watch "Doubt in access of tx stuff in stateless and stateful bean" New topic
Author

Doubt in access of tx stuff in stateless and stateful bean

Deep Chand
Ranch Hand

Joined: Dec 17, 2002
Posts: 133
HF book on page 228 it's mentioned that

Stateless bean CAN NOT get a transaction reference and call methods on it (BMT) in ejbCreate & ejbRemove methods.

On page 196 it's mentioned that

Stateful bean CAN get a transaction reference and call methods on it (BMT) in ejbCreate & ejbRemove methods.

Is this right and if yes, then why is that difference in the behavior of Stateless vs Stateful? Also, it's mentioned that both stateful & stateless beans can't invoke setRollbackOnly & getRollbackOnly on CMT beans in ejbCreate/ejbRemove methods. Why that differentitation between BMT and CMT beans?

Please reply.

Thanks
Deep
ravi janap
Ranch Hand

Joined: Nov 04, 2000
Posts: 389
Hi Deep

A stateless/stateful session bean with CMT ejbCreate, ejbRemove methods are called with an unspecified transaction context.

A stateless/stateful session bean with BMT ejbCreate, ejbRemove methods are called with a transaction context.

Please refer to Valentin Crettaz's cheat sheets:

http://www.valoxo.ch/jr/BeanLC.pdf

Thanks

-- Ravi


SCJP, SCJD, SCWCD, SCBCD, SCEA
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt in access of tx stuff in stateless and stateful bean