dev@glassfish.java.net

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

From: Kenneth Saks <Kenneth.Saks_at_Sun.COM>
Date: Tue, 14 Apr 2009 10:51:11 -0400

On Apr 13, 2009, at 10:50 PM, Dies Koper wrote:

> Hi Ken,
>
> Thanks for the quick reply.
>
> In the V3 source EntityContainer.java and
> StatelessSessionContainer.java still do not implement the
> onShutdown() and onTermination() methods.

A lot of this has changed in the V3 codebase. The application life
cycle framework is new so the methods are not necessarily named the
same as before. See doConcreteContainerShutdown().

>
> Could you tell me how/where have you fixed this issue?
> Do you have an issue number of revision number I can refer to?
>
> Thanks!
> Dies
>
> Kenneth Saks wrote:
>> On Apr 8, 2009, at 10:44 PM, Dies Koper wrote:
>>> 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?
>> Hi Dies,
>> This was a longstanding bug in V2 and earlier. In V3 the bean
>> instances
>> for each container type are explicitly removed during both server
>> shutdown
>> and undeploy.
>> --ken
>>>
>>> Thanks,
>>> Dies
>