Aren't the stateful bean instances pooled once the client calls remove method ?
posted 7 years ago
You must destroy a stateful bean instance by using the @Remove annotation when the conversation ends. Any business method can be annotated with @Remove so that upon successful completion of that business method, the bean instance will be destroyed. If you do not remove stateful bean instances when they are no longer needed,then the number of inactive (essentially dead) instances will grow, forcing passivation/ activation in the container. In addition to @Remove, most containers provide the ability to time out and destroy a bean instance by setting an expiration time in the vendor-specific deployment descriptor. This timeout can be used to help keep the number of bean instances to a manageable number. Its purpose is to set a timer for beans that are not used by clients for longer than the specified expiration time. It is recommended you take advantage of this timeout to reduce the time that unused bean instances hang around, soaking up space.