tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From is_maximum <mnr...@gmail.com>
Subject transaction rolls back when returning from a remove method of a SFSB
Date Mon, 14 Dec 2009 10:13:17 GMT

Hello
I have a Stateful session bean with three method preProcess, process and
postProcess. the postProcess method marked with @Remove 
these three methods are called in one method of a stateless session bean.
After calling the postProcess the transaction will mark to rollback. I put a
bunch of System.out to pring out getRollbackOnly() of the session context
and I am sure no exception occured. At the point just before returning from
postProcess the log shows the getRollbackOnly() is false but in callee
method right after this method invocation getRollbackOnly() is true!!!! 

Does anybody know what the problem is? 

Furthermore, When I comment out the @Remove annotation the whole transaction
works fine but I don't know what will happen on the deserted stateful
session bean which is not destroyed manually!

[code]
class MyStatefullSB {
   @Remove 
   public void postProcess() { 
     .... 
     logger.debug(sc.getRollbackOnly()); //prints out false 
   } 

}

class MyStatelessSB {

   public void someMethod() { 

      mystateful.preProcess(); 
      mystateful.process(); 
      mystateful.postProcess(); 
      logger.debug(sc.getRollbackOnly()); //prints out true!!!! 
  } 
}
[/code]


-----
--
Regards

Mohammad Norouzi

Help each other to reach the future faster

http://pixelshot.wordpress.com Pixelshot Photoblog 

http://brainable.blogspot.com Brainable Blog 


-- 
View this message in context: http://old.nabble.com/transaction-rolls-back-when-returning-from-a-remove-method-of-a-SFSB-tp26775547p26775547.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Mime
View raw message