How & where the Stateful EJB maintains the sesssion for the particular client.
The
how depends on the implementation as does the
where (although you can safely answer this one with "on the server-side").
Here's a general description of the process:
1) The client fetches a reference, a proxy, for a stateful bean. The reference he gets contains the vendor-speficic information needed for the EJB Container to recognize the correct bean instance.
2) The EJB Container receives the invocation and finds the bean instance the request is intended for. This can be done at least in a couple of different ways:
2.a) The EJB Container lets the bean instance hold the state in its instance variables and passivates the bean if necessary.
2.b) The EJB Container holds the state somewhere else, in some kind of a database, and picks the bean instance from an anonymous pool (a bit like stateless session beans) giving the state to the bean instance just-in-time before delegating the method call.
[ August 11, 2003: Message edited by: Lasse Koskela ]