Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JBoss User Help »

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

scott.stark@jboss.org

2007-06-19


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
_______________________________________________
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user
©2008 junlu.com - Jax Systems, LLC, U.S.A.