TransactionAttribute.Isolation Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan atau mengatur tingkat isolasi transaksi.
public:
property System::EnterpriseServices::TransactionIsolationLevel Isolation { System::EnterpriseServices::TransactionIsolationLevel get(); void set(System::EnterpriseServices::TransactionIsolationLevel value); };
public System.EnterpriseServices.TransactionIsolationLevel Isolation { get; set; }
member this.Isolation : System.EnterpriseServices.TransactionIsolationLevel with get, set
Public Property Isolation As TransactionIsolationLevel
Nilai Properti
Salah TransactionIsolationLevel satu nilai.
Contoh
Contoh kode berikut mendapatkan dan menetapkan nilai Transaction
properti atribut Isolation .
[Transaction(Isolation=TransactionIsolationLevel.Serializable)]
public class TransactionAttribute_Isolation : ServicedComponent
{
public void IsolationExample()
{
// Get the TransactionAttribute applied to the class.
TransactionAttribute attribute =
(TransactionAttribute)Attribute.GetCustomAttribute(
this.GetType(),
typeof(TransactionAttribute),
false);
// Display the current value of the attribute's Isolation property.
Console.WriteLine("TransactionAttribute.Isolation: {0}",
attribute.Isolation);
// Set the Isolation property value of the attribute.
attribute.Isolation = TransactionIsolationLevel.RepeatableRead;
// Display the new value of the attribute's Isolation property.
Console.WriteLine("TransactionAttribute.Isolation: {0}",
attribute.Isolation);
}
}
<Transaction(Isolation := TransactionIsolationLevel.Serializable)> _
Public Class TransactionAttribute_Isolation
Inherits ServicedComponent
Public Sub IsolationExample()
' Get the TransactionAttribute applied to the class.
Dim attribute As TransactionAttribute = CType(Attribute.GetCustomAttribute(Me.GetType(), GetType(TransactionAttribute), False), TransactionAttribute)
' Display the current value of the attribute's Isolation property.
MsgBox("TransactionAttribute.Isolation: " & attribute.Isolation)
' Set the Isolation property value of the attribute.
attribute.Isolation = TransactionIsolationLevel.RepeatableRead
' Display the new value of the attribute's Isolation property.
MsgBox("TransactionAttribute.Isolation: " & attribute.Isolation)
End Sub
End Class
Berlaku untuk
Berkolaborasi dengan kami di GitHub
Sumber untuk konten ini dapat ditemukan di GitHub, yang juga dapat Anda gunakan untuk membuat dan meninjau masalah dan menarik permintaan. Untuk informasi selengkapnya, lihat panduan kontributor kami.