• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB - Activation and Passivation

 
prasanna Sundarrajan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai
I am new to EJB. Can any one explain what is activation and passivation.
Prasanna
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The life-cycle of EJBs is managed by the EJB Container. Activation and passivation are closely related to this life-cycle.
When the container figures that a particular stateful SessionBean instance has not being used for a while, it decides to passivate it temporarily in order to release resources. The bean instance remains in the passivated state until a method invocation request comes in from the client and the container activates it again.
So, the activation/passivation is a means of freeing reserved resources while they're not being used. These resources can be JDBC connections, JMS connections, JCA connections, etc. Upon ejbPassivate() the bean should release the resources (as they cannot be serialized anyway) and store the necessary information for re-obtaining these resources upon ejbActivate().
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!