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 distributed transaction flow through the use of web service messaging and coordinates interoperably 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 integrated with the Microsoft Distributed Transaction Coordinator (MSDTC) transaction manager. WCF applications can transmit 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 endpoint. 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 connection.

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 execute the two-phase execution protocol between the client transaction manager and the server transaction in order to resolve the transaction result.

If 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 the enrolled participants of each protocol, the Coordinator starts with 2PC Volatile and proceeds up to 2PC Durable. The final 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 who manage durable resources, such as a database, must register with this protocol.

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