views:

41

answers:

1

How do I explicitly destroy an EJB instance in code and take it out of circulation? I have an ejb class that becomes unusable after it throws a certain exception. After that I need to remove it from the app servers pool of instances.

A: 

What does "destroy" mean when most Java EE app servers pool EJB instances? Don't you really mean "put it back in the pool"?

If you think you have too many instances, change the pool sizes in app server configuration.

duffymo
I wish to trigger the operation that the app server uses to invoke the @PreDestroy method as well as its side effects. Thanks.
mglmnc