aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Operations permitted during bean creation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Operations permitted during bean creation" Watch "Operations permitted during bean creation" New topic
Author

Operations permitted during bean creation

Norm Mattson
Greenhorn

Joined: Jun 13, 2003
Posts: 4
Paul,

I downloaded your SCBCD Exam Study Kit ebook a few weeks ago and am about half way through it now. After reading the section on session beans there is one topic that I'm not sure I fully understand. Could you explain why resource manager access and access to other beans is permitted in an ejbCreate method for stateful session beans but is prohibited for stateless session beans?

Thanks
[ July 27, 2005: Message edited by: Norm Mattson ]
Vicky Bajaj
Greenhorn

Joined: Jun 30, 2003
Posts: 11
I am not very sure but what I think is because ejbCreate and ejbRemove in stateful session bean are controlled by Calling client i.e. when you call home.remove(...) on Stateful session bean, the container invokes ejbRemove and same as with home.create(..). So in Client identity is available in ejbCreate and ejbRemove that's why access to Resource managers and other enterprise beans is allowed in ejbCreate and ejbRemove methods in Stateful session bean.

Someone pls correct if I am wrong.
Paul Sanghera
Ranch Hand

Joined: Jul 26, 2005
Posts: 38
Originally posted by Norm Mattson:
Paul,

I downloaded your SCBCD Exam Study Kit ebook a few weeks ago and am about half way through it now. After reading the section on session beans there is one topic that I'm not sure I fully understand. Could you explain why resource manager access and access to other beans is permitted in an ejbCreate method for stateful session beans but is prohibited for stateless session beans?

Thanks

[ July 27, 2005: Message edited by: Norm Mattson ]

Norm:
Another way of saying what Vicky said is:
Accessing resource managers (and also other enterprise beans for that matter) is prohibited in those session bean methods for which the container (at call time) does not have a meaningful transaction context or client security context. It's very important to remember that the creation and removal of a stateless session bean does not depend upon a client call.
Hope it helps.
Norm, also make sure you check the errata at Author Online forum which can be accessed from:
http://www.manning.com/sanghera


Paul Sanghera, Ph.D.<br />SCBCD, SCJP, Project+, Network+, Linux+, CNA.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Operations permitted during bean creation
 
Similar Threads
how session beans service simultaneous client calls
TOMCAT 7 - Jboss 5.1.0.GA - Spring - JSP - I need some guidance.
ENTITY BEAN LIFE CYCLE: ALLOWED METHODS.
can I ommit the ServiceLocator from the component diagram?
controller or model