2 Replies Latest reply on Aug 3, 2007 1:56 AM by surajmundada

    How to implement Transaction and Rollback

    surajmundada Newbie

      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