dev@glassfish.java.net

why are SLSB and Entity bean instances not released from pool during server stop?

From: Dies Koper <diesk_at_fast.au.fujitsu.com>
Date: Thu, 9 Apr 2009 12:44:12 +1000

Hi Mitesh,

I have a question about the instance pool for Stateless and Entity beans.

When stopping the server, instances in the pool are not cleaned up,
ejbRemove, unsetEntityContext callback methods are not called and
PreDestroy intercepter methods are not called. They are when undeploying
an application.
Why are these callback methods not called when a server is stopped?

In the source:
com/sun/ejb/containers/EntityContainer.java
com/sun/ejb/containers/StatelessSessionContainer.java

onShutdown() and onTermination() methods are not implemented, while they
are for MDBs and SFSBs.

The EJB spec seems to indicate these methods should be called to bring
back the instances to their "does not exist" status, but is it because
we are stopping the VM anyway?

Thanks,
Dies