This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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,
 
wood burning stoves
 
subject: Session bean ejbCreate method
 
Similar Threads
quite pulzzed
Stateful Session bean - Meaningful Tx context
Access to other beans and resource manager
Bean things in afterCompletion()
(With wonderful replies) what decides access to Resource manager/Enterprise bean?