Hi,
I was just going through the tests section and trying to write
a test assigned to me long back :) and I stumbled upon this issue.
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.
The StatelessInstanceManager has a discardInstance method that is empty.
Is my understanding right here. Shall I open a JIRA and start working on this?
Regards
Manu