Hello: This is my first post and as english is not my mother tongue the less i write -> the less i'll be wrong ;-). Here we go: The spec says that it's allowed to access a Resource manager in ejbCreate, ejbRemove..ejbPassivate methods of a CMTSFB. Oks, but after says:
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.
The ejbCreate<METHOD>, ejbRemove, ejbPassivate, and ejbActivate methods of a session bean with container-managed transaction demarcation execute with an unspecified transaction context. Refer to Subsection 17.6.5 for how the Container executes methods with an unspecified transaction context.
In SFSB, the following methods ejbCreate, ejbActivate, ejbPassivate, ejbRemove have access to security context, which allows them to have access to another beans method or resource manager (although methods run in "unspecified Tr context"... read the lines in Spec carefully, it uses the key word 'OR'). Hope, this answers to your question.
Hello: mmmmmmmmmmm oks, then (if it means transaction context OR security context) why can't you access a resource manager from afterComptetion(), this method runs with an unspecified transaction context but DOES has security context..and the specs says it can't. Thanks again!
The table 2 on page 80 on EJB specification states that an enterprise bean may be accessed in the ejbCreate method; however, since a transaction context is unspecified for this method, the behaviour of executing ejbCreate() is not guaranteed by the container