Page 266 Chapter 7 Session Bean Richard Monson Haefel
Enterprise JavaBeans 2.0 Specification:
The container manages the life cycle of the session bean instances. It notifies the instances when bean action may be necessary, and it provides a full range of services to ensure that the session bean implementation is scalable and can support a large number of clients.
To efficiently manage the size of its working set, a session bean container may need to temporarily transfer the state of an idle stateful session bean instance to some form of secondary storage.
Hey guys this is what is commonly known as resource pooling. No where does it state that these actions are restricted to stateless session beans only.
Now a quote from Mastering EJB:
EJB does indeed support the effect of pooling stateful session beans. Only a few instances can be in memory when there are actually many clients. But this pooling effect does not come for free - the passavation/activation steps could entail an input/output bottleneck. Contrast this to stateless session beans, which are easily pooled because there is no state to save.
[ April 18, 2002: Message edited by: Chris Mathews ]
2. Does the passivated instance of the bean is used to serve the other requests ?
My answer to both is "No".
Hence I do not think that stateful session Bean are "POOLED".
Passivating Stateful session bean reduces the memory utilization on the server. I think it does not indicates that the passivated instance of the bean is re-used to serve another request.