How to remove EJB2.1 Stateless session bean
Greetings all, I have a qu开发者_Go百科estion: How to remove an EJB session bean (especially Stateless beans) ?
There's of course remove() method, however it cannot be called while the session object is in transaction i.e. session bean A is called by another session bean B in it's business method.
A Stateless bean can't be removed by the client, in fact they never "die", that's because the container uses a pool of stateless session beans to handle user's request.
A stateful bean is taken out from the pool and attached to a client only while the method call lasts, after that, the container put it back into the pool. Oddly, the remove method is only useful to realease resources for stateful and entity beans, the container always ignores the remove method for stateless session beans.
精彩评论