• 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.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!