• 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 wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

488/158 ICE question: CMP entity bean life-cycle

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
488/158 ICE question: CMP entity bean life-cycle
Ok, here goes...this sample question is driving me nuts. Please note my primary reference is the O'Reilly book, Enterprise JavaBeans, 3rd Ed. by Monson-Haefel. ICE Question asks to order these events once the client has invoked the create() method on a CMP entity bean.
a. Container creates an EJBObject
b. EJB home object invokes ejbCreate() on bean instance.
c. Bean instance is associated with EJBObject.
d. Container creates new bean instance.
e. Container calls setEntityContext() on bean instance.
f. Container creates the bean representation in a database.
g. ejbPostCreate() method is invoked on the bean method
Here's what I believe is the order:
1. d - Container creates multiple copies for each deployed bean for availability in the instance pool
2. e - The first method called after a bean is instantiated is setEntityContext()
3. (no letter...) - Client invokes create() on home stub
4. b - as a result of #3, ejbCreate() with matching parameters is invoked
5. a - Container creates EJB Object. (I believe the remote reference returned to the client will reference this object � is this true?)
6. f - insert new record in database
6. c - EJB Ojbect is associated with an instance from the instance pool with it's newly inserted record in the database
7. g - ejbPostCreate() is invoked
Needless to say, my sequence isn't listed as an answer. I'd appreciate any feedback on this topic as I am trying to prepare for the new 158 (old 488) IBM exam for Websphere Application Server 4.0. Thanks ahead of time!
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your belief looks very close to one of the answers; b,f,a,c,g.
And I agree with the answer leaving d and e out.... because they happen before the create() method where the question is asking you to start off.... The question may/should read, "After a client invokes the create() method...
But, I still don't understand the placement of f.
Data is not inserted into the database until after ejbPostCreate(). So, does f not mean data insertion into database?
I would appreciate it, if someone could take the time and help out a little bit in explaining this, and/or reference some material to find the information.
Thanks.
kyle
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by danno:
488/158 ICE question: CMP entity bean life-cycle
...
Needless to say, my sequence isn't listed as an answer. I'd appreciate any feedback on this topic as I am trying to prepare for the new 158 (old 488) IBM exam for Websphere Application Server 4.0. Thanks ahead of time!



OK, the right answer to this question is a).
When you start the server it instantiates the bean d) and calls setEntityContext e).
When the client tries to invoke create the server is already running and the steps d) and e) are already performed. So a), b), c), f) and g) are left and need to be put in the right order.
When the client invokes create the EJB home object invokes ejbCreate() b).
As it is a CMP Entity Bean ejbCreate() inserts a new record to the database f). That is a representation of the bean with the primary key to indentify the bean.
After that the EJBObject is created a) and assigned to the bean instance c).
Now follows ejbPostCreate() g).
Hopefully this helps.
Jochen
[ May 02, 2002: Message edited by: Jochen van Waasen ]
 
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jochen van Waasen:

Hopefully this helps.
Jochen
[ May 02, 2002: Message edited by: Jochen van Waasen ]


yes. it helps a lot.
Axel
 
danno
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jochen - thanks! That is definitely the right answer as I am getting 100% for that section of the test exam. Thanks again for your help!
reply
    Bookmark Topic Watch Topic
  • New Topic