Transaction Management in Windows

Published: December 28, 2005 | Updated: February 13, 2006

Transaction management capability is included in Windows 2000, Windows XP, Windows Server 2003 and Windows Server 2003 R2, and will also be available in the forthcoming releases of Windows Vista. With this capability, Windows can coordinate transactions that update two or more transaction-aware resources, as one logical unit of work. Transaction-aware resources might include databases, message queues, legacy transaction processing systems, or even file systems. Developers can easily take advantage of transactions, and Windows can coordinate transactions across these resources, whether they are local or distributed across multiple networked computers.

*
**
**
On This Page
Overview of Transaction ManagementOverview of Transaction Management
Learn MoreLearn More
Support ArticlesSupport Articles
DownloadsDownloads

Overview of Transaction Management

Transactions are an essential element for building reliable applications. When applications involve multiple, distributed subsystems or when applications are composed of multiple, independent components, transactions help an application cleanly deal with failures in one of the distinct pieces. As one example, large-scale, connected e-commerce applications will typically employ transactions for order processing.

Transactions make it easier to develop and administer this class of applications by providing the "ACID" properties:

Atomicity - All changes performed as part of the transaction happen, or none of them happen.

Consistency - Data is transformed from one correct state to another.

Isolation - Multiple concurrent updaters are prevented from interfering with one another.

Durability - Committed changes remain permanent, even in the face of failures.

Transaction Management in Windows

Microsoft Windows, including Windows 2000, Windows XP, Windows Server 2003 and Windows Server 2003 R2, includes transaction management capabilities, to allow any Windows application to take advantage of transactions. The Microsoft Distributed Transaction Coordinator (DTC) has been available in Windows since the Windows NT 4.0 timeframe, is included in Windows 2000, Windows XP, and Windows Server 2003, and will be included in Windows Vista and Longhorn server. The DTC performs very well; in the TPC-C benchmark from the independent Transaction Processing Performance Council, benchmark entries that use Windows, COM+, and DTC rank very highly in absolute performance as well as in price/performance.

The transaction management capabilities in Windows are intended for use by enterprise software developers, including Independent Software Vendors (ISVs) and end customers who construct robust, scalable, distributed applications. These capabilities are exposed to developers via various programming interfaces.

C++ libraries - Applications utilize the transaction functionality provided by DTC by directly calling into the DTC libraries. This capability continues for current and future versions of Windows.

COM+ - Applications that are based on COM components can host them in COM+, and utilize the COM+ transaction services.

System.EnterpriseServices - With the introduction of the .NET Framework v1.0 and the System.EnterpriseServices namespace in 2002, any .NET application could participate in transactions.

System.Transactions – With the introduction of the .NET Framework v2.0 and the System.Transactions namespace in November 2005, any .NET application can take advantage of new, simpler interfaces for transactions, as well as significant performance optimizations.

System.Transactions

The System.Transactions namespace in .NET 2.0 introduces simpler ways to perform transactional work, as well as some new performance optimizations. For the former, there are simplified programming interfaces for beginning and committing transactions. For the latter, a key feature is Transaction Coordinator Promotion. With this optimization, an application will use a more efficient local transaction, unless a distributed transaction is required at runtime. .NET 2.0 also introduces a simpler interface for constructing a transaction-aware resource manager. This means it will be easier to use transactions in a much broader range of scenarios. Often, people think of transactions as being useful primarily for enterprise applications, but System.Transactions makes transactions accessible and usable for departmental applications, simpler, smaller applications, and in fact any application in which roll forward and rollback semantics might be useful. Using these new interfaces, ACID Transactions can even be wrapped around in-memory constructs such as collections or lists.

Going Forward

Microsoft will continue to enhance the transaction support within Windows, including the distributed transaction coordinator. For example, the Windows Communication Foundation feature, which will be part of Windows Vista, will deliver a communications mechanism that is transaction aware. This means that applications that connect via WCF will be able to propagate transactional context automatically. In addition, in Windows Vista, Microsoft will be extending the reach of transactions, by providing transactional extensions for the Windows Registry and for the Windows file system. This means, for example, an application could update a database and the file system, as one atomic unit of work.

ACID transactions require strong assurances of trust and concurrent availability among all participants. In scenarios where this is not possible, a more loosely-coupled model must be used. In contrast to the very fast, "all-or-nothing" model for atomic transactions, the loosely-coupled case must allow for work to occur over a much longer period of time, and might allow for user input, re-submission of portions of the work, and even partial back out or failure. When a so-called "long-running transaction" like this is cancelled, compensating actions are applied to undo every action that was taken as part of the sequence of events leading up to the cancellation. The Windows Workflow Foundation in Windows Vista will support this model of transaction.

In summary, transactions provide a powerful tool for building resilient, reliable applications. Microsoft Windows includes transaction support today, and Microsoft will make transactions simpler and more broadly applicable in the future.

Top of pageTop of page

Learn More

Overview of System.Transactions
Version 2.0 of the .NET Framework introduces a new transaction API available in the System.Transactions namespace. The new model allows developers to utilize transactions coordinated by the DTC with low runtime overhead, and a simple developer experience.

MSDN TV: Introducing System.Transactions
In this brief video, Mike Clark introduces the System.Transactions namespace in the .NET Framework 2.0.

Transaction Processing documentation on MSDN
This documentation provides an introduction to transactions, a programmer's guide, and a programmer's reference.

Top of pageTop of page

Support Articles

New Features in MS DTC
This article describes new functionality in the Microsoft Distributed Transaction Coordinator (MSDTC) service in Windows Server 2003 SP1 or Windows Server 2003 R2, and Windows XP SP2.

Registry Entries to enable XA transactions in Windows XP SP2 or Windows Server 2003
The Microsoft Distributed Transaction Coordinator (MS DTC) requires that all XA libraries be listed in the registry. This requirement was added to Windows Server 2003 and Windows XP SP2 to minimize the risks associated with using third-party XA DLLs in the MS DTC process. This article describes the required registry values.

How to configure Microsoft Distributed Transaction Coordinator on a Windows Server 2003 cluster
This article describes how to install the Microsoft Distributed Transaction Coordinator (MSDTC) resource on a Windows Server 2003 cluster.

Configuring the Distributed Transaction Coordinator to Work Through a Firewall
The DTC uses RPC dynamic port allocation. You can set ranges for allowable ports for dynamic allocation, which allows DTC to operate across a firewall which restricts traffic to specific ports. This article describes how to set the allowable port range.

Top of pageTop of page

Downloads

Distributed Transaction Coordinator Management Pack for MOM
With this add-on to Microsoft Operations Manager, you can proactively manage the Microsoft DTC and identify issues before they become critical.

COM+ Hotfix for Windows Communication Foundation
This hotfix adds support for the WS-AtomicTransaction protocol to MSDTC and support for transaction propagation via Windows Communication Foundation.


Top of pageTop of page