ChannelDispatcher.TransactionIsolationLevel Vlastnost

Definice

Získá nebo nastaví výchozí úroveň izolace pro transakce.

public:
 property System::Transactions::IsolationLevel TransactionIsolationLevel { System::Transactions::IsolationLevel get(); void set(System::Transactions::IsolationLevel value); };
public System.Transactions.IsolationLevel TransactionIsolationLevel { get; set; }
member this.TransactionIsolationLevel : System.Transactions.IsolationLevel with get, set
Public Property TransactionIsolationLevel As IsolationLevel

Hodnota vlastnosti

IsolationLevel

Jedna z IsolationLevel hodnot. Výchozí formát je Unspecified.

Výjimky

Sada úrovní izolace není definována.

Komunikační objekt je ve Opening stavu nebo Opened ve stavu.

Komunikační objekt je ve Closing stavu nebo Closed ve stavu.

Komunikační objekt je ve Faulted stavu.

Příklady

Uri baseAddress = new Uri("http://localhost:8001/Simple");
ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService), baseAddress);

serviceHost.AddServiceEndpoint(
    typeof(ICalculator),
    new WSHttpBinding(),
    "CalculatorServiceObject");

serviceHost.Open();

IChannelListener icl = serviceHost.ChannelDispatchers[0].Listener;
ChannelDispatcher dispatcher = new ChannelDispatcher(icl);
dispatcher.TransactionIsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
Dim baseAddress As New Uri("http://localhost:8001/Simple")
Dim serviceHost As New ServiceHost(GetType(CalculatorService), baseAddress)

serviceHost.AddServiceEndpoint(GetType(ICalculator), New WSHttpBinding(), "CalculatorServiceObject")

serviceHost.Open()

Dim icl As IChannelListener = serviceHost.ChannelDispatchers(0).Listener
Dim dispatcher As New ChannelDispatcher(icl)
dispatcher.TransactionIsolationLevel = System.Transactions.IsolationLevel.ReadCommitted

Poznámky

TransactionIsolationLevel Pomocí vlastnosti získejte nebo nastavte výchozí úroveň izolace pro nové transakce vytvořené dispečerem pro službu.

Tuto vlastnost lze nastavit pouze v případě, že instance ChannelDispatcher je ve Created stavu, protože to je jediný stav, který je jak proměnlivý, tak nelikvidovaný.

Platí pro