|
When WS-AtomicTransaction protocols are used, the coordinator controller service can be referred to as an atomic transaction coordinator. This particular implementation of the WS-Coordination coordinator service represents a specific service model. The atomic transaction coordinator plays a key role in managing the participants of the transaction process, and in deciding the transaction’s ultimate outcome.
|
|
The atomic transaction process
|
|
As previously mentioned, the atomic transaction coordinator is tasked with the responsibility of deciding the outcome of a transaction. It bases this decision on feedback it receives from all of the transaction participants.
|
|
As shown in the following diagrams, the collection of this feedback is separated into two phases. During the prepare phase, all participants are notified by the coordinator and each is asked to prepare and then issue a vote. Each participant’s vote consists of either a “commit” or “abort” request.
|
|
In the following figure, the coordinator is requesting that transaction participants prepare to vote.
|
|
|
Nex, the transaction participants vote on the outcome of the atomic transaction.
|
|
|
Once the votes are collected, the atomic transaction coordinator enters the commit phase. It now reviews all votes and decides whether to commit or rollback the transaction.
|
|
The conditions of a commit decision are simple: if all votes are received and if all participants voted to commit, the coordinator declares the transaction successful, and the changes are committed. However, if any one vote requests an abort, or if any of the participants fail to respond, then the transaction is aborted and all changes are rolled back.
|
|
|
In the diagram above, the coordinator finally aborts the transaction and notifies participants to rollback all changes.
|
Implementing a WS-AtomicTransaction Coordination Type
|
|
The specific protocol(s) that establish the rules and constraints of a service activity within WS-Coordination are identified within the CoordinationType element. The URI values that are placed here are predefined within the WS-AtomicTransaction specification.
|
|
In the following example, the CoordinationType element is assigned the WS-AtomicTransaction coordination type identifier, which communicates the fact that the header’s context information is part of a short running transaction.
|
<wsc:CoordinationType>
http://schemas.xmlsoap.org/ws/2003/09/wsat
</wsc:CoordinationType>
|
To learn more about WS-AtomicTransaction, view the specification by visiting www.soaspecs.com
|