A browser took up a stateful session bean from another browser
 Technote (troubleshooting)
 
Problem(Abstract)
What is the relationship between a browser and stateful session bean.
 
Cause
It could be that the reference of the stateful session bean (SFSB) is kept as a member variable of the Servlet.
 
Resolving the problem
There is no relationship between a browser and an EJB. There may be a relationship between a Servlet and an EJB, where the Servlet is the client of the EJB but there is no direct relationship between the HTTP session and any persistent state of a stateful session bean.
The only way anything can relate to a stateful session bean (SFSB) is by having a reference to it. When calling a SFSB from a Servlet, keep the reference in an HTTPSession object, since an HTTP session is associated with exactly one browser. This way each client can have its own SFSB reference. Do not keep the reference in a servlet instance variable, since there is only a single servlet instance for all the clients/browsers that access that servlet.

If two calls are made to the same SFSB instance simultaneously, one of them will work but the other will get a BeanNotReentrantException (a subclass of RemoteException). Since this is likely to happen if you put the SFSB reference in a servlet instance variable, the instance variable technique is not recommended.
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > EJB Container
Operating system(s): z/OS
Software version: 6.0.2
Software edition:
Reference #: 1228229
IBM Group: Software Group
Modified date: Aug 23, 2007