dev@glassfish.java.net

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

From: Dies Koper <diesk_at_fast.au.fujitsu.com>
Date: Tue, 14 Apr 2009 12:50:30 +1000

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.

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