Export (0) Print
Expand All
Expand Minimize

TransactionIsolationLevel Enumeration

Specifies the value of the TransactionAttribute.

Namespace: System.EnterpriseServices
Assembly: System.EnterpriseServices (in system.enterpriseservices.dll)

[SerializableAttribute] 
public enum TransactionIsolationLevel
/** @attribute SerializableAttribute() */ 
public enum TransactionIsolationLevel
SerializableAttribute 
public enum TransactionIsolationLevel

 Member nameDescription
AnyThe isolation level for the component is obtained from the calling component's isolation level. If this is the root component, the isolation level used is Serializable
ReadCommittedShared locks are held while the data is being read to avoid reading modified data, but the data can be changed before the end of the transaction, resulting in non-repeatable reads or phantom data. 
ReadUncommittedShared locks are issued and no exclusive locks are honored. 
RepeatableReadLocks 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. 
SerializablePrevents updating or inserting until the transaction is complete. 

The following code example demonstrates the use of the TransactionIsolationLevel type.

using System;
using System.EnterpriseServices;
using System.Reflection;

// References:
// System.EnterpriseServices

// An instance of this class will inherit its caller's transaction isolation
// level if available. If not, it will use isolation level Serializable.
[Transaction(Isolation=TransactionIsolationLevel.Any)]
public class TransactionAttribute_IsolationAny : ServicedComponent
{
}

// An instance of this class will read only committed data, but non-repeatable
// reads and phantom rows are still possible.
[Transaction(Isolation=TransactionIsolationLevel.ReadCommitted)]
public class TransactionAttribute_IsolationReadCommitted : ServicedComponent
{
}

// An instance of this class will read committed and uncommitted data, so dirty
// reads, non-repeatable reads, and phantom rows are possible.
[Transaction(Isolation=TransactionIsolationLevel.ReadUncommitted)]
public class TransactionAttribute_IsolationReadUncommitted : ServicedComponent
{
}

// An instance of this class will read only committed data and place shared
// locks on the data, preventing other users from modifying it, but other users
// can still insert rows into the data set, so phantom rows are still possible.
[Transaction(Isolation=TransactionIsolationLevel.RepeatableRead)]
public class TransactionAttribute_IsolationRepeatableRead : ServicedComponent
{
}

// An instance of this class will read only committed data and place a range
// lock on the data set, preventing other users from updating or inserting rows
// into the data set until its transaction is complete.
[Transaction(Isolation=TransactionIsolationLevel.Serializable)]
public class TransactionAttribute_IsolationSerializable : ServicedComponent
{
}


import System.*;
import System.EnterpriseServices.*;
import System.Reflection.*;

// References:
// System.EnterpriseServices
// An instance of this class will inherit its caller's transaction isolation
// level if available. If not, it will use isolation level Serializable.
/** @attribute Transaction(Isolation = TransactionIsolationLevel.Any)
 */
public class TransactionAttribute_IsolationAny extends ServicedComponent
{
} //TransactionAttribute_IsolationAny

// An instance of this class will read only committed data, but non-repeatable
// reads and phantom rows are still possible.
/** @attribute Transaction(Isolation = TransactionIsolationLevel.ReadCommitted)
 */
public class TransactionAttribute_IsolationReadCommitted 
    extends ServicedComponent
{
} //TransactionAttribute_IsolationReadCommitted

// An instance of this class will read committed and uncommitted data, so dirty
// reads, non-repeatable reads, and phantom rows are possible.
/** @attribute Transaction(Isolation = TransactionIsolationLevel.
    ReadUncommitted)
 */
public class TransactionAttribute_IsolationReadUncommitted 
    extends ServicedComponent
{
} //TransactionAttribute_IsolationReadUncommitted

// An instance of this class will read only committed data and place shared
// locks on the data, preventing other users from modifying it, but other users
// can still insert rows into the data set, so phantom rows are still possible.
/** @attribute Transaction(Isolation = TransactionIsolationLevel.
    RepeatableRead)
 */
public class TransactionAttribute_IsolationRepeatableRead 
    extends ServicedComponent
{
} //TransactionAttribute_IsolationRepeatableRead

// An instance of this class will read only committed data and place a range
// lock on the data set, preventing other users from updating or inserting rows
// into the data set until its transaction is complete.
/** @attribute Transaction(Isolation = TransactionIsolationLevel.Serializable)
 */
public class TransactionAttribute_IsolationSerializable 
    extends ServicedComponent
{
} //TransactionAttribute_IsolationSerializable

Windows 98, 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, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft