System.Data.IsolationLevel Enumeration

Specifies the transaction locking behavior for the connection.

Syntax

public enum IsolationLevel

Remarks

The System.Data.IsolationLevel values are used by a .NET Framework data provider when performing a transaction.

The System.Data.IsolationLevel remains in effect until explicitly changed, but it can be changed at any time. The new value is used at execution time, not parse time. If changed during a transaction, the expected behavior of the server is to apply the new locking level to all statements remaining.

Members

Member NameDescription
Chaos

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

ReadCommitted

Shared locks are held while the data is being read to avoid dirty reads, but the data can be changed before the end of the transaction, resulting in non-repeatable reads or phantom data.

ReadUncommitted

A dirty read is possible, meaning that no shared locks are issued and no exclusive locks are honored.

RepeatableRead

Locks are placed on all data that is used in a query, preventing other users from updating the data. Prevents non-repeatable reads but phantom rows are still possible.

Serializable

A range lock is placed on the System.Data.DataSet, preventing other users from updating or inserting rows into the dataset until the transaction is complete.

Snapshot

Reduces blocking by storing a version of data that one application can read while another is modifying the same data. Indicates that from one transaction you cannot see changes made in other transactions, even if you requery.

Unspecified

A different isolation level than the one specified is being used, but the level cannot be determined.

Requirements

Namespace: System.Data
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0, 2.0.0.0