| For stateless session beans, what is the mechanism of creating and destroying? |
|
Currently the Container has a rather simple approach to stateless session beans. It creates as many session beans as are needed to support every concurrent use. So, if three clients simultaneously call a session bean, three instances are used. Stateless session beans do not have a timeout in EJB. Thus, they will never actually be removed. They remain in a pool to be ready to serve future requests on the bean. Note that in practice one needs one thread per access to an EJB object, so one will run out of memory for threads long before one will run out of memory for beans. So, we believe not bounding or compacting the pool is not a serious problem.
|