[jboss-user] [EJB 3.0 Users] - Re: Stateful session beans don't keep state !!!

PeterJ do-not-reply at jboss.com
Thu Oct 8 11:29:25 EDT 2009

When the client asks for an EJB, it gets a proxy for the EJB, not the EJB itself.

If the proxy is for a stateless bean (SLSB), when the client calls a method on the proxy, the server allocates a bean from a pool. Once the method is completed the bean is placed back in the pool. Any subsequent calls to methods on the SLSB repeat this pattern. 

If the proxy is for a stateful bean (SFSB) then the server allocate a bean specifically for that proxy. As long as the client calls methods on that proxy the same SFSB will handle the calls. If the client does another lookup, it gets a new proxy and a new SFSB instance for that proxy. 

Hope that explanation helps.

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4259401#4259401

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4259401

More information about the jboss-user mailing list