aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Missed PreDestroy callback calls Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Missed PreDestroy callback calls " Watch "Missed PreDestroy callback calls " New topic
Author

Missed PreDestroy callback calls

Deepak Jain
Ranch Hand

Joined: Aug 05, 2006
Posts: 637
****************************************
---------------
Environment
---------------
EJB Version : 3.0
Application Server: JBOSS 4.2.3.GA
J2SE: 1.5 or 5.0
OS: Windows XP
****************************************



EJB 3.0 Core Specification:
If the Remove method completes successfully or if the Remove methods throws an application exception for which retainIfException is not true or if a system exception is thrown, SessionSynchronization methods are not called on the bean instance.

----------
Questions
----------
I invoked the client 3 times with changes in the session bean as follows
1) The client invokes die() [A remove method], The Remove method completes successfully.
2) The client invokes die() [A remove method], The Remove method {retainIfException=false} throws a application exception.
3) The client invokes die() [A remove method], The Remove method {retainIfException=false} throws a system exception.

In all the above 3 cases , all the methods in SessionSynchronization were invoked. In the last case afterCompletion was invoked with false because the container automatically rollbacked the transaction.This clearly violates the statement from specification.

Can someone explain this behavior?


SCJP, SCWCD, SCBCD
Deepak Jain
Ranch Hand

Joined: Aug 05, 2006
Posts: 637
Experts, Please take time and reply.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Missed PreDestroy callback calls