File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes 7.7.2 of EJB Spec Creating Session Object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "7.7.2 of EJB Spec Creating Session Object" Watch "7.7.2 of EJB Spec Creating Session Object" New topic
Author

7.7.2 of EJB Spec Creating Session Object

Giju George
Ranch Hand

Joined: Jun 08, 2004
Posts: 333
The figure 6 shows that, while creating a Session Object, the client invoked the create on EJB(Local)Home and then the "EJB (local)Home calls new on the EJB(local) Object". From what I understood was, the client calls create on EJB(local)Home and then the home calls it on the instance of the bean. So the EJB(local)Object is no where coming in between. I understand that the create "RETURNS" an EJB (local)Object....


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCEA
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
And your question is?

Not sure whether you finally understood the figure or not. Please let us know


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Giju George
Ranch Hand

Joined: Jun 08, 2004
Posts: 333
My ques is, Does EJB(local) Home "CALLS" EJB(local)Object while creating a session Object???. That's what the diagram shows. The Home only "RETURNS" the EJB Object.

Or, am I misunderstanding the OID diagram??
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
What the diagram shows is that when a client invokes create on a EJB(Local)Home of a stateful session bean, the home first creates a new EJB(Local)Object, then a new instance of the session bean class on which it sets the context and finally it initializes the newly created session bean by invoking ejbCreate() on it.

This process is described in section 7.6 of the EJB spec which states:

A [stateful] session bean instance�s life starts when a client invokes a create<METHOD>(...) method on the session bean�s home interface. This causes the container to invoke newInstance() on the session bean class to create a new session bean instance. Next, the container calls setSessionContext() and ejbCreate<METHOD>(...) on the instance and returns the session object reference to the client. The instance is now in the method ready state.


Is it more clear? Don't hesitate otherwise
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: 7.7.2 of EJB Spec Creating Session Object
 
Similar Threads
Local and Remote References
stateless session bean's ejbCreate method
which is first created EJB Object or Bean Instance
Local Home interface
allowed operation in ejbCreate() of stateless session bean