• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Missed PreDestroy callback calls

 
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.
 
Create symphonies in seed and soil. For this tiny ad:
professionally read, modify and write PDF files from Java
https://products.aspose.com/pdf/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!