• 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:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic