Transaction Coordination

Posted by Admin on 08-Mar-2010 11:02

How does transaction coordination work with Sonic ESB? I have two web services accessing different databases within the enterprise. I want to handle them in a transaction. Do I have to use the compensation technique even though my databases are within the same enterprise? If I have to use the compensation technique, how do I do it? I did checkout the Sonic cook-a-long on Transactions but it was very high level.

All Replies

Posted by Thomas Mercer-Hursh on 16-Mar-2010 17:51

Mike Ormerod did a very nice presentation on transactions in an ESB/SOA world at either the Paris Exchange or PSDN Live.  The PPT should be floating arount on PSDN somewhere.

Short version:

With two OE databases, you could, of course, always use two phase commit, but that implies one service accessing both databases and I would guess from your question that this is not your design (probably rightly so).

I believe it is possible to support XA transactions across the bus, but you probably don't really want to do that since the performance hit is significant and, of course you are up a creek if one of the databases is down.

So, yes, you should be thinking in terms of a fire and forget structure with a mechanism for undoing or compenstating if there turns out to be an error.  Doing this sensibly tends to mean that you have taken due precaution before you fire and forget to make sure that it is very likely that the remote transaction will complete.

This thread is closed