Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

7.7.2 of EJB Spec Creating Session Object

 
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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....
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And your question is?

Not sure whether you finally understood the figure or not. Please let us know
 
Giju George
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
There's a city wid manhunt for this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic