Instance Passivation

Passivation is a useful feature the EJB container provides specifically for stateful session beans. Passivation occurs when the EJB is not currently in the middle of a client transaction, and the EJB server decides it needs to swap out the bean to free up some memory or other system resources. The swapped out EJB can then be activated again, usually on the next client interaction that requires it.

For stateful session beans, the client is always returned to the same unique session object once it is activated again. Only the particular client that initially created this session object can do so. This is necessary to retain the conversational state as well as to provide security for the information the client has placed within ...

Get Developing Enterprise Java Applications with J2EE™ and UML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.