IsolationLevel Enumeration

 

Specifies the isolation level of a transaction.

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

Public Enumeration IsolationLevel

Member nameDescription
Chaos

The pending changes from more highly isolated transactions cannot be overwritten.

ReadCommitted

Volatile data cannot be read during the transaction, but can be modified.

ReadUncommitted

Volatile data can be read and modified during the transaction.

RepeatableRead

Volatile data can be read but not modified during the transaction. New data can be added during the transaction.

Serializable

Volatile data can be read but not modified, and no new data can be added during the transaction.

Snapshot

Volatile 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.

Unspecified

A 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.

.NET Framework
Available since 2.0
Return to top
Show: