Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use transactions and rollbacks in an SOA architecture

I'm currently working on a SOA project.

I have to develop several processing chains, that is to say a web-services that chain web-services inside an ESB in Java.

Since every web-service to chain can throw different exception, I thought about using Transactions to be able to rollback the web-services behaviors.

However, I have no idea if this is even possible in an SOA environnement when every service is different. I searched it and found some information about AtomicTransactions but I'm not sure it's can be used to solve my problem.

To conclude, my questions are is it actually possible to rollback services? And if so, how can I set it up?

Thanks in advance.

like image 243
qbisson Avatar asked Jan 22 '14 19:01

qbisson


1 Answers

Using transactions between services is not a good practice as you're holding up resources for components that are not necessarily trustworthy, plus service processes are usually long-running (I wrote about it more in "transactional-integration anti-pattern".

As someone mentioned in a comment I find that the "saga pattern" is a better way to handle these long running interactions

like image 94
Arnon Rotem-Gal-Oz Avatar answered Oct 27 '22 00:10

Arnon Rotem-Gal-Oz