How is the state of the Stateful session bean maintained. Like how an HttpSession can be maintained using URL rewriting or cookies. Similary how does EJB container identifies the Stateful Session Bean for a unique client.
Also what would be the timeout period for a Stateful Session Bean.
Hi, EJBcontainer maintains the stateful session bean state.if any webbased clinet accesses EJB the EJBclient session is maintained by HTTPsession.if the session period is out, container maintains a beans state.
Joined: Dec 23, 2002
I would like to know the concept of how does the EJB Container manages the state.
The biggest difference between the stateful session bean and the other bean types is that stateful session beans don't use instance pooling. Stateful session beans are dedicated to one client for their entire life, so there is no swapping or pooling of instances. Instead of pooling instances, stateful session beans are simply evicted from memory to conserve resources. The EJB object remains connected to the client, but the bean instance is dereferenced and garbage collected during inactive periods. This means that a stateful bean must be passivated before it is evicted to preserve the conversational state of the instance, and it must be activated to restore the state when the EJB object becomes active again.
 Some vendors use pooling with stateful session beans, but that is a proprietary implementation and shouldn't impact the specified life cycle of the stateful session bean.