Q:

how to roll back web service in spring MVC

I have a multiple webservices to be call.
Suppose I call a webservice to save some data to their local DataBase. After I get response from the webservice I check the response for following situation:
1- Let's take first service was successful and second too.
2- Let's consider the third webService fails, In this situation I need to roll back first and second web service calls!
How can I do that?  

A:

Ravi,
There is something called as Transaction, and when it goes for Distributed, it is called as XATransaction.
Hope this helps: basic spring based transaction
With and without XATransaction
You have to remember, that your requirement is Global Transaction, any where exception will Rollback all the Transaction(Insert...etc processing).

