tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manu T George (JIRA)" <j...@apache.org>
Subject [jira] Closed: (OPENEJB-747) pre-destroy callbacks not getting called on throwing a RuntimeException in the business method of a stateless session bean.
Date Tue, 08 Jan 2008 06:02:34 GMT

     [ https://issues.apache.org/jira/browse/OPENEJB-747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Manu T George closed OPENEJB-747.
---------------------------------

    Resolution: Fixed

Clarification from David Blevins

In the case of Stateless beans, an instance is removed from the pool
(via StatelessInstanceManager.getInstance) before we invoke the
 business method to ensure only one thread is executing that instance.
 If the business method throws a system exception, we simply don't put
 it back into the pool (would be via
 StatelessInstanceManager.poolInstance) and it should eventually be
 garbage collected.
 
 I added some comments to that affect in the StatelessContainer and
 StatelessInstanceManager.
 

> pre-destroy callbacks not getting called on throwing a RuntimeException in the business
method of a stateless session bean.
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OPENEJB-747
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-747
>             Project: OpenEJB
>          Issue Type: Bug
>          Components: container system
>    Affects Versions: 3.0-beta-1
>         Environment: Win XP Sun JDK 5
>            Reporter: Manu T George
>            Assignee: Manu T George
>             Fix For: 3.0-beta-2
>
>
>   In the case of stateless beans, if a system execption is thrown
> during the execution of an ejb business method, the instance is not
> getting destroyed. There is already a test for this in
> StatelessLocalBusinessIntfcTests and it is commented out.
>        Section: 4.5.3 of the EJB core spec says
> A RuntimeException that is not an application exception thrown from
> any method of the enterprise
> bean class (including the business methods and the lifecycle callback
> interceptor methods invoked by
> the container) results in the transition to the "does not exist" state.
> If you see the State diagram of the Lifecycle of a Stateless Session
> Bean the transition from the method ready state to the does not exist
> state involves the invocation of the PreDestroy callbacks.
> So my understanding here is that the preDestroy method should be called.
> But there is more in the spec which is given below
> From the client perspective, the session object continues to exist.
> The client can continue accessing the
> session object because the container can delegate the client's
> requests to another instance.
> So this means that the proxy should not be invalidated and the
> preDestroy callbacks called.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message