0

Greetings all, I have a question: 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.

daytek
  • 1
  • 1
  • I think you under the misapprehension that you have to remove stateless beans to free resources or something. – Yishai Oct 18 '10 at 16:05

1 Answers1

0

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.