aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Session bean ejbCreate method 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 » Java » EJB and other Java EE Technologies
Bookmark "Session bean ejbCreate method" Watch "Session bean ejbCreate method" New topic
Author

Session bean ejbCreate method

Gan nit
Greenhorn

Joined: Feb 02, 2005
Posts: 3
Hi,
According to tHe EJB spec:

"Accessing resource managers and enterprise beans is disallowed in the session bean methods for which the Container does not have a meaningful transaction context or client security context."

How come Resource Manager access and Enterprise bean access are allowed in the ejbCreate, ejbRemove, ejbActivate and ejbPassivate methods on a STATEFUL session bean. THe spec also says:

"The getRollbackOnly and setRollbackOnly methods of the SessionContext interface should be used only in the session bean methods that execute in the context of a transaction. SInce the ejbCreate, ejbRemove, ejbActivate and ejbPassivate methods of a STATEFUL session bean execute in an unspecified transaction context the getRollbackOnly and setRollbackOnly methods should not be called from these methods."

If the ejbCreate, ejbRemove, ejbActivate and ejbPassivate methods of a STATEFUL session bean execute in an unspecified transaction context, how can they be allowed to access the Resource Manager and other Enterprise beans?

Please clarify.


Thanks very much,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Session bean ejbCreate method