Best Practices

A client should explicitly remove a stateful session bean by calling the remove() method of the component interface. Otherwise, the container keeps the stateful bean until it times out. This wastes resources such as memory, secondary storage, and so on.

Stateful session beans cannot be shared among different clients. A multithreaded client (such as a servlet or a Swing application) must serialize all its calls to the stateful session bean. Simultaneous access to a stateful session bean results in a java.rmi.RemoteException exception.

Consider tuning the stateful session bean's instance cache size. For best performance, the maximum number of beans in the cache should be equal to maximum number of concurrent clients. If the cache size is less than the number of concurrent clients, the container triggers activation and passivation, which degrades performance.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.76.72