• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Activation and Passivation

 
Gus Dur
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question from Whizlab :
In a Catalog Enterprise Bean, (used in an online sports shopping site) you have code that will be executed when ejbPassivate() and ejbActivate() are called. The code is used to perform basic house keeping tasks. You need to know when the code will execute so which of the following statements are true?
A. ejbPassivate() is called prior to passivation.
B. ejbPassivate() is called immediately after passivation.
C. ejbActivate() is called prior to activation.
D. ejbActivate() is called immediately after activation.
The answer is : A, and D
But when I read Ed Roman (2nd Edition book),
it says :
ejbPassivate() called immediately "before" your
bean is passivated
ejbPassivate() called immediately "before" your
bean is activated
So which one is right ??
 
Billy JK
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The test is right :
- ejbPassivate() called immediately prior to passivation of the bean instance;
- ejbActivate() is called immediately following the succesful activation of a bean instance.
( for ex see Monson-Haefel page 61 )
In Roman's book it might be a typo, copy/paste error ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic