Transaction Class

Note: This class is new in the .NET Framework version 2.0.

Represents a transaction.

Namespace: System.Transactions
Assembly: System.Transactions (in system.transactions.dll)

public class Transaction : IDisposable, ISerializable
/** @attribute SerializableAttribute() */ 
public class Transaction implements IDisposable, ISerializable
public class Transaction implements IDisposable, ISerializable

The System.Transactions namespace 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.

The Transaction class contains methods used by developers implementing resource managers for enlistment. It also provides functionalities for cloning a transaction and controlling the current transaction context. You can obtain the current transaction, if one is set, using the static Current property.

This type is safe for multithreaded operations.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0