Specifies the isolation level of a transaction.
public enum class IsolationLevel
public enum IsolationLevel
type IsolationLevel =
Public Enum IsolationLevel
|Chaos Chaos Chaos Chaos||5||
The pending changes from more highly isolated transactions cannot be overwritten.
|ReadCommitted ReadCommitted ReadCommitted ReadCommitted||2||
Volatile data cannot be read during the transaction, but can be modified.
|ReadUncommitted ReadUncommitted ReadUncommitted ReadUncommitted||3||
Volatile data can be read and modified during the transaction.
|RepeatableRead RepeatableRead RepeatableRead RepeatableRead||1||
Volatile data can be read but not modified during the transaction. New data can be added during the transaction.
|Serializable Serializable Serializable Serializable||0||
Volatile data can be read but not modified, and no new data can be added during the transaction.
|Snapshot Snapshot Snapshot Snapshot||4||
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 Unspecified Unspecified Unspecified||6||
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.