Web Service Transactions
I just came across an on Web Services Transactions at developerWorks. This is the first time someone attempted to show some code. This is a nice attempt.
The author took an example of travel reservation system, which includes air ticket, hotel, and auto reservations. When any of these fails, the user wants to cancel the whole booking. In a tightly-coupled scenario, with the databases and services are deployed across a reliable network, I can imagine an atomic unit of work across these three phases of the reservation process.
When the same services are loosely coupled, instead of rolling back a transaction, thee coordinator asks each service for compensating services. For a hotel reservation, a compensating service would be cancelling the reservation. Instead of the travel reservation system worry about compensating each service, it could rely on the coordinator do that job.
But the process of coordination and compensation isn’t simple, and involves a number of details, and there lies the devil:
- Transaction context: The client will have to get the transaction context and make sure to propagate it to each service. Since the transaction can be long running, the client will have to manage this transaction context for the duration of the service. In this example, the client will have to keep track of this context for the duration of the reservation process.
- Transaction state: Each step in a long running transaction usually involves creating or changing some state. For example, the hotel reservation could result in a confirmation number. For the coordinator to be able to compensate, the coordinator need to know this confirnation number.
These details are automatically taken care in the case of short-running transactions, because the transaction occurs within the context of a short running thread and connections. But in the case of web services, both the client and service will have to deal with some fair amount of extra complexity. WS-Transaction and WS-Coordination won’t be usable until this complexity is abstracted into web services runtime implementations.



Hello,
“WS-Transaction and WS-Coordination won’t be usable until this complexity is abstracted into web services runtime implementations.”
Can you please elabroate the statement above a bit more, Do you mean this has to be abstracted in WS-Runtime Implementation Engines like Apache AXIS 2.0 etc ?? What’s that extra complexity that client & servivce has to deal as well ?
Cheers
Abhijeet