What you're describing is exactly what's supposed to be happening. You're not supposed to invoke the @Remove method from your own code. When the bean container passivates the instance, it calls @Remove for you.
On Mon, Dec 14, 2009 at 5:13 AM, is_maximum <[email protected]> wrote: > > 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. > >
