This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Missed PreDestroy callback calls

 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
****************************************
---------------
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?
 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Experts, Please take time and reply.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic