Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

process of different EJB's Passivation and Activation

 
ruilin yang
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Could anyone discribe the different process of Passivation/Activation of: 1) stateful session bean; 2) CMP, and 3) BMP entity beans ?
At each case what is required from the client to perform or the client even do not know all what happened ?
I am not clear these process.
Thanks
Ruilin
 
Suresh Gnanasekaran
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yang,
ejbActivate() and ejbPassivate() works differently for Entity Bean and Session Bean. If you see this link they have criticized EJB Spec http://www.onjava.com/pub/a/onjava/2001/02/28/ejb.html

For CMP and BMP :- ejbActivate() - When the bean instance is assigned to EJB Object (From Pooled State to Ready State). Once assigned to EJB Object ejbActivate() method is called.
ejbPassivate() - When the bean instance is dissociated with from EJB Object. After this the bean goes to Pooled State (From Ready State to Pooled State)
Stateful Session Bean - When the bean instance is not serving methods from client. To conserve resources the container can passivate bean by calling ejbPassivate(). When the client call a method on EJBObject then the ejbActivate() is called.
I hope I have explained
Thanks
 
ruilin yang
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suresh,
Thanks,
This means ejbPassivate method has to be called by the container before an entity-bean disassociate with the EJBObject. Client is completely unaware of this process.
Thanks again
Ruilin
 
ruilin yang
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Anyone can give me a clarification:
When a bean is passivated its state is serialized to disk ? Is it correct ? How to understand this ?
Please give comments
Thanks,
Ruilin
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic