System.Transactions Namespace

The System.Transactions namespace contains classes that allow you to write your own transactional application and resource manager. Specifically, you can create and participate in a transaction (local or distributed) with one or multiple participants.

The System.Transactions infrastructure makes transactional programming simple and efficient throughout the platform by supporting transactions initiated in SQL Server, ADO.NET, MSMQ, and the Microsoft Distributed Transaction Coordinator (MSDTC). It provides both an explicit programming model based on the Transaction class, as well as an implicit programming model using the TransactionScope class, in which transactions are automatically managed by the infrastructure. It is highly recommended that you use the easier implicit model for development. To get started, please see the Implementing an Implicit Transaction using Transaction Scope topic. For more information on writing a transactional application, see Writing A Transactional Application.

System.Transactions also provides types for you to implement a resource manager. The transaction manager native to the System.Transactions infrastructure allows volatile resources or a single durable resource enlistment to commit or roll back efficiently. For more information on implementing a resource manager, see Implementing a Resource Manager.

System.Transactions defines three levels of trust that restrict access on the types of resources it exposes.

Specifically, theSystem.Transactions assembly can be called by partially trusted code as it has been marked with theAllowPartiallyTrustedCallers attribute (APTCA). This attribute essentially removes the implicit LinkDemand for theFullTrust permission set that is otherwise automatically placed on each publicly accessible method in each type. However, some types and members still require stronger permissions.

Read Users' Comments (0)

0 Response to "System.Transactions Namespace"

Post a Comment