Win a copy of Terraform in Action this week in the Cloud 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Confusion on EJB Life Cycle HFEJB Pg 94, 100

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HFEJB on Pg 94 has a picture that shows Step 5 where the call to create() method is shown in steps : The services kick in and the bean is created followed by EJBObject is made.

But on Pg 100, in the Architectural Overview :Creating a Stateful Session Bean, the process is shown reversed. It shows that first the EJBObject is created for the bean and then the bean is instantiated.

Which one is the correct one to be followed or there is something which I have misread/misinterpreted.
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe that the container creates the EJBObject before the bean. As you will see in the later chapters, EJBObect is always created before the bean. (For stateful session beans)

Look at page 179, 192 of HF-EJB
 
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Chander Puri:
HFEJB on Pg 94 has a picture that shows Step 5 where the call to create() method is shown in steps : The services kick in and the bean is created followed by EJBObject is made.

But on Pg 100, in the Architectural Overview :Creating a Stateful Session Bean, the process is shown reversed. It shows that first the EJBObject is created for the bean and then the bean is instantiated.

Which one is the correct one to be followed or there is something which I have misread/misinterpreted.




I think the order doesn't really matters, unless until the container gives the bean the beanness. Here it matters, because depending on the different moments in the bean lifecycle, the bean class can perform some operation rather than others.

The important moment is when the Container invokes setSessionContext() and ejbCreate(), linking bean instance, EJBObject and SessionContext together.

Marco
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic