ServiceBehaviorAttribute::TransactionIsolationLevel Property
Specifies the transaction isolation level for new transactions created inside the service, and incoming transactions flowed from a client.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
public: property IsolationLevel TransactionIsolationLevel { IsolationLevel get(); void set(IsolationLevel value); }
Property Value
Type: System.Transactions::IsolationLevelA IsolationLevel value that specifies the transaction isolation level. The default is Unspecified.
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException | The value is not one of the IsolationLevel values. |
The isolation level in which your transaction runs determines how data is treated when changes are made in other transactions and how long your transaction must hold locks to protect against these changes. For example, the default value, Unspecified, specifies that no updating or inserting can occur until the transaction is complete.
This property can also be used to restrict the isolation level of incoming transactions flowed from a client.
The following code example sets the transaction isolation level to ReadCommitted, does not support concurrent transactions, requires a flowed transaction from the method call, and commits the transaction automatically if no unhandled exception occurs.
The underlying binding must support flowed transactions for the following code example to execute properly. To support flowed transactions using the WSHttpBinding, for example, set the TransactionFlow property to true in code or in an application configuration file. The following code example shows a configuration file for the preceding sample.
Available since 3.0