It's not a secret anymore!*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes StateFul ejbCreate 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 "StateFul ejbCreate" Watch "StateFul ejbCreate" New topic
Author

StateFul ejbCreate

Weerawit Maneepongsawat
Ranch Hand

Joined: Apr 11, 2002
Posts: 203
1. What's happen when i try to commit in ejbCreate method for BMT, Can i use method on UserTransaction in ejbCreate method on BMT stateful.
2. For CMT Can i use get or setRollbackOnly() on SessionContext in ejbCreate
Thank you


Weerawit<br />SCJP 1.4, SCWCD 1.2, SCWCD 1.4, SCBCD 1.3, SCBCD 5.0, SCMAD 1.0, SCJA 1.0, SCDJWS, SCJD, SCEA, SCDJWS 1.5
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
You can find answers to these questions in the EJB specification 2.0
1. What's happen when i try to commit in ejbCreate method for BMT, Can i use method on UserTransaction in ejbCreate method on BMT stateful.
Section 7.6.1, Table 2: Stateful BMT session beans are allowed to invoke methods on the UserTransaction interface within the ejbCreate method
2. For CMT Can i use get or setRollbackOnly() on SessionContext in ejbCreate
Section 7.6.1, Table 2: Stateful CMT session beans are not allowed to invoke setRollbackOnly() on the SessionContext interface within the ejbCreate method


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Weerawit Maneepongsawat
Ranch Hand

Joined: Apr 11, 2002
Posts: 203
Thank you for quick reply.
but i want to know why in container point of view. Can anyone help me pls..
Sany Bel
Ranch Hand

Joined: Mar 12, 2004
Posts: 51
Because according to the specs "The ejbCreate<METHOD>, ejbRemove, ejbPassivate, and ejbActivate methods
of a session bean with container-managed transaction demarcation execute with an unspecified
transaction context."


--------------<br />Sany Bel<br />SCJP 1.4, SCBCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: StateFul ejbCreate