• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB - Activation and Passivation

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai
I am new to EJB. Can any one explain what is activation and passivation.
Prasanna
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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().
reply
    Bookmark Topic Watch Topic
  • New Topic