Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

transaction gets rolled back when returning from a method of a session bean

 
Mohammad Norouzi
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

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 in a stateless session bean. After calling the postProcess the transaction is maked 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 of returning from postProcess the log shows the getRollbackOnly() is false but in callee method right after this method getRollbackOnly() is true!!!

Does anybody know what the problem is?

@Remove
public void postProcess() {
....
logger.debug(sc.getRollbackOnly()); //prints out false
}


//in stateless SB
public void someMethod() {

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

}


 
Mohammad Norouzi
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I've just removed the @Remove from the method and now it works fine but what happens for a stateful without a remove method? What was the problem?
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which application server are you using? The logs might contain more details as to what's going on.
 
Mohammad Norouzi
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jaikiran Pai wrote:Which application server are you using? The logs might contain more details as to what's going on.


I am using Glassfish I'll try to post the log tomorrow
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic