• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic