|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
Writing a Transactional Application
As a transactional application programmer, you can take advantage of the two programming models provided by thenamespace to create a transaction. You can utilize the explicit programming model by using the class, or the implicit programming model in which transactions are automatically managed by the infrastructure, by using the class.. It is recommended that you use the implicit transaction model for development. You can find more information on how to use a transaction scope in the topic.
Both models support committing a transaction when the program reaches a consistent state. If the commit succeeds, the transaction is durably committed. If the commit fails, the transaction aborts. If the application program cannot successfully complete the transaction, it attempts to abort and undo the transaction's effects.
In This Section
Creating a Transaction
The System.Transactions namespace provides two models for creating a transaction. These models are covered in the following topics.
Describes how the System.Transactions namespace supports creating implicit transactions using the TransactionScope class.
Describes how the System.Transactions namespace supports creating explicit transactions using theclass.
Escalating Transaction Management
When a transaction needs to access a resource in another application domain, or if you want to enlist in another durable resource manager, the transaction is automatically escalated to be managed by the MSDTC. Transaction escalation is covered in thetopic.
The topicdemonstrates how concurrency can be achieved between asynchronous tasks by using the class.
The topicillustrates how you can make your distributed transactions interact with COM+ transactions.
describes how you can use the trace codes that are generated by the System.Transactions infrastructure to troubleshoot errors in your applications.
Working within ASP.NET
Thetopic describes how you can successfully use System.Transactions inside an ASP.NET application.