Hai I am new to EJB. Can any one explain what is activation and passivation. Prasanna
posted 13 years ago
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().