Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Access to resource manager in CMTSFB

 
Javi Moreno
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

and
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.

Any help?
Thanks, javi.
 
Baskaran Vengesanam
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Javi Moreno
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Javi Moreno
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have just read it in one mock exam:
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

:-)
Chao!
[ April 30, 2004: Message edited by: Javi Moreno ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic