In his book about
patterns for enterprise architecture, Martin Fowler describes the "Server Session" pattern -- a strategy in which session state is stored on the server instead of on the client.
In the
Java PetStore application, for example, the Shopping Cart is implemented as a stateful session bean on the application server.
The Shopping Cart is associated with the end user's web browser, but the immediate client of the
EJB tier is the Web tier. That being the case, what mechanism maintains the association between individual Shopping Cart EJBs with individual clients of the web tier?
That is to say, when the web tier gets a request from the user to add to his shopping cart, how does the web tier (or other intermediary) look up the Shopping Cart stateful session bean associated with that particular user? Which component maintains the association between customer userIds and shopping cart stateful session EJB handles?