[jboss-user] [JBoss Seam] - How to implement Transaction and Rollback

surajmundada@yahoo.com do-not-reply at jboss.com
Tue Jun 19 03:43:29 EDT 2007


Hi, 

I have a method which calls some other methods. 


  |       public String parentMethod()
  |       {
  |             try
  |             {
  |                  childMethod1();
  |                  childMethod2();
  |                  childMethod3();
  |             }
  |             catch(Exception e)
  |             {
  |                   facesMessages.add(errorMessage);
  |             }
  | 
  |             return actionOutCome;
  |       }
  | 

All the child methods update some data in db. 

But if any of the child method fails to perform correctly(throws exception), I want to roll back the changes made by other methods. 

How can I do this? 

I read about @Transactional and @Rollback (ifOutCome="") 

Could not get more on how to use @Transactional ... and can not use @Rollback as method returns the same string (JSF Action Outcome) each time for page navigation. 

Regards, 

Suraj

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055481#4055481

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055481



More information about the jboss-user mailing list