Xpode.com        Click here to Print this article.

Java Interview Questions: - What do you mean by Passivation and Activation in EJB?

When we are dealing with stateful session beans we need to store the client conversation of the bean so that it can be available in client’s next request. But when we talk about server it has limited resources. If the conversation of the bean is large then the server can run out of resource. So in order to preserve resources EJB server swaps this conversational data in memory to hard disk thus allowing memory to be reclaimed. This process of saving the memory data to hard disk is called as “Passivation”. Now when the client comes back the conversational data is again swapped from the hard disk to the bean. This process is called as “Activation”. The container informs the bean that its about to passivate or activate using the "ejbPassivate()" and "ejbActivate()" methods.

See the following video on Getting started with EJB in Java: -

Click to get Java Interview Questions

Regards,

Get more Java Interview Questions from author's blog



http://
http://

Contributed by:
Shivprasad Koirala
We conduct training for Java/J2EE technologies like design patterns, J2EE, Struts, Hibernate, Spring, Rich Interface etc. and likes to write articles on the same in free time.

Resourse address on xpode.com
http://www.xpode.com/Print.aspx?Articleid=622

Click here to go on website