Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mock Exam Question

 
Alibabra Sanjie
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
8. At what point, precisely, in the life-cycle is a container-managed entity bean considered created?

A. Immediately prior to the execution of its ejbCreate() method
B. Immediately after the execution of its ejbCreate() method
C. After the CMP bean's data has been committed to the underlying persistent datastore
D. During the execution of its ejbPostCreate() method


8. At what point, precisely, in the life-cycle is a container-managed entity bean considered created?
D is incorrect Answer, (B) is correct: Immediately after the execution of its ejbCreate() method

Why
 
Dale Seng
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought "D" was right too. According to the spec, page 207, there is no EJBObject immediately after the ejbCreate<M> method. Although the event following ejbCreate<M> next event is a "new" on the EJBObject. It's not a very meaningful question anyway because the bean can't do anything until ejbPostCreate<M> starts, and the client can't do anything until ejbPostCreate<M> completes and the home supplies the reference to the component object.

--Dale--
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe that B is correct. An entity bean does not need access to an EJB object to be a bean. Think about a passivated bean: the container passivates a bean in order to disassociate it from an EJB object and to move it back into the pool. There is no suggestion that a bean which is in the pool is just an ordinary object instead of a bean.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic