Otis wrote:
heh indeed, sounds like fun, such an undo operation
.
Is is
Otis wrote:
The positives of this approach include the fact that there are no locks held and if failures are infrequent, then this performs exceptionally well. You just have to get the compensation framework right and your laughing.
Which is impossible IMHO: a transaction which is 'somewhat' atomic is IMHO not reliable. Of course, if failures are infrequent and IF a failure is happening, it can be corrected, it's fine.
It all goes back to your requirements... If atomic transactions are required, then you are right, this is not possible using the compensation model. Your best bet is to use COM+ which doesn't fit with the the web service model.
However if you allow yourself to look at services as autonomous, which is one of basic tenents of SOA, then you you have a little more scope for adventure
. Data is owned (and governed) by a service. Therefore if 2 services are talking to each other then the idea of an atomic transaction becomes less important. What becomes more important is that each service is happy about the state of its own data at any given moment in time. And the overall key to this is how an application is split into multiple services.
Most developers feel the need to split applications into lots of services (because that's what MS and others, (probably ignorant managers) are recommending). But thats a load of CRAP. Service boundaries are very difficult to get right and are nearly always done incorrectly. The very fact that an atomic transaction is required across a service boundary is IMHO an indication that the service boundary is incorrect.
If you spend a good portion of your design time understanding the data in your domain, you will spot some natural data segmentation. Services in SOA must exploit this natural segmentation in order to correctly determine an appropriate service boundary. An atomic transaction should IMHO never be required across such a boundary and hence the compensation model (including its limitations) fits nicely.
If anyone wants to read up on data segmenation and how this applies to service design, I recommend Pat Helland's article on http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/dataoutsideinside.asp
BTW - the only way to UNDO a delete, it not to delete in the first place.
And if you don't have unlimited storage space, then a higher level 2 phase commit is required to sanction the final delete.