ContextUtil.IsInTransaction Eigenschaft
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Ruft einen Wert ab, der angibt, ob der aktuelle Kontext transaktional ist.
public:
static property bool IsInTransaction { bool get(); };
public static bool IsInTransaction { get; }
static member IsInTransaction : bool
Public Shared ReadOnly Property IsInTransaction As Boolean
Eigenschaftswert
true
, wenn der aktuelle Kontext transaktional ist, andernfalls false
.
Ausnahmen
Es ist kein COM+-Kontext verfügbar.
Beispiele
Im folgenden Codebeispiel wird der Wert einer IsInTransaction Eigenschaft abgerufen.
[Transaction(TransactionOption::Required)]
public ref class ContextUtil_IsInTransaction: public ServicedComponent
{
public:
void Example()
{
// Display whether the current COM+ context is enlisted in a
// transaction.
Console::WriteLine( "Current context enlisted in transaction: {0}",
ContextUtil::IsInTransaction );
}
};
[Transaction(TransactionOption.Required)]
public class ContextUtil_IsInTransaction : ServicedComponent
{
public void Example()
{
// Display whether the current COM+ context is enlisted in a
// transaction.
Console.WriteLine("Current context enlisted in transaction: {0}",
ContextUtil.IsInTransaction);
}
}
<Transaction(TransactionOption.Required)> _
Public Class ContextUtil_IsInTransaction
Inherits ServicedComponent
Public Sub Example()
' Display whether the current COM+ context is enlisted in a
' transaction.
MsgBox("Current context enlisted in transaction: " & ContextUtil.IsInTransaction)
End Sub
End Class
Gilt für:
Feedback
https://aka.ms/ContentUserFeedback.
Bald verfügbar: Im Laufe des Jahres 2024 werden wir GitHub-Issues stufenweise als Feedbackmechanismus für Inhalte abbauen und durch ein neues Feedbacksystem ersetzen. Weitere Informationen finden Sie unterFeedback senden und anzeigen für