IsolationLevel Enumeration

Specifies the isolation level of a transaction.

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

public enum IsolationLevel
public enum IsolationLevel
public enum IsolationLevel

 Member nameDescription
ChaosThe pending changes from more highly isolated transactions cannot be overwritten. 
ReadCommittedVolatile data cannot be read during the transaction, but can be modified. 
ReadUncommittedVolatile data can be read and modified during the transaction. 
RepeatableReadVolatile data can be read but not modified during the transaction. New data can be added during the transaction. 
SerializableVolatile data can be read but not modified, and no new data can be added during the transaction. 
SnapshotVolatile data can be read. Before a transaction modifies data, it verifies if another transaction has changed the data after it was initially read. If the data has been updated, an error is raised. This allows a transaction to get to the previously committed value of the data. 

When you try to promote a transaction that was created with this isolation level, an InvalidOperationException is thrown with the error message "Transactions with IsolationLevel Snapshot cannot be promoted".

UnspecifiedA different isolation level than the one specified is being used, but the level cannot be determined. An exception is thrown if this value is set. 

The data affected by a transaction is called volatile. When you create a transaction, you can specify the isolation level that applies to the transaction. The isolation level of a transaction determines what level of access other transactions have to volatile data before a transaction completes.

The lowest isolation level, ReadUncommitted, allows many transactions to operate on a data store simultaneously and provides no protection against data corruption due to interruptive transactions. The highest isolation level, Serializable, provides a high degree of protection against interruptive transactions, but requires that each transaction complete before any other transactions are allowed to operate on the data.

The isolation level of a transaction is determined when the transaction is created. By default, the System.Transactions infrastructure creates Serializable transactions. You can determine the isolation level of an existing transaction using the IsolationLevel property of a transaction.

Windows 98, Windows Server 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 Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions