WS-AtomicTransaction – Development of mobile applications, web services, SOA architecture - Technology
Pular para o conteúdo

WS-AtomicTransaction – Mobile app development, web services, SOA architecture

Adverts

WS-AtomicTransaction (WS-AT) is an interoperable transaction protocol. It enables the flow of distributed transactions through the use of Web service messages and interoperably coordinates across heterogeneous transaction infrastructures. WS-AT uses the two-phase execution protocol to create an atomic result between distributed applications, transaction managers, and resource managers.

The provided implementation of WS-AT in Windows Communication Foundation (WCF) includes a protocol service built into the Microsoft Distributed Transaction Coordinator (MSDTC) transaction manager. WCF applications can pass transactions to other applications through WS-AT, including interoperable web services built using third-party technology.

When a transaction flows between a client application and a server application, the transaction protocol used is determined by the binding that the server exposes on the selected client terminal. Some bindings provided for WCF by default specify the OleTransactions protocol as the transaction propagation format, while others default to the WS-AT specification. You can also programmatically modify the choice of transaction protocol within a given binding.

The choice of protocol influences:

  • The format of the message headers used to flow the transaction from the client to the server.
  • The network protocol used to run the two-phase execution protocol between the client transaction manager and the server transaction in order to resolve the transaction outcome.

If both the server and client are written using WCF, you don't need to use WS-AT. Instead, you can use the default NetTcpBinding configuration with the TransactionFlow attribute enabled, which will use the OleTransactions protocol.

This specification defines the following protocols for atomic transactions.

conclusion: The termination protocol starts the confirmation process. Based on each protocol's enrolled participants, the Coordinator starts with 2PC Volatile and progresses up to 2PC Durable. The end result is signaled to the initiator.

Two-Phase Commitment (2PC): The 2PC protocol coordinates registered participants to reach a confirmation or cancellation decision and ensures that all participants are informed of the final outcome. The 2PC protocol has 2 variants:

  • Volatile 2PC: The Participants managing volatile resources such as a cache must register with this protocol.
  • Durable 2PC: Participants managing durable resources such as a database must register with this protocol.

A participant can register for more than one of these protocols by sending multiple registration messages.