Freigeben über


ContextUtil.EnableCommit-Methode

Legt im COM+-Kontext das consistent-Bit auf true und das done-Bit auf false fest.

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

Syntax

'Declaration
Public Shared Sub EnableCommit
'Usage

ContextUtil.EnableCommit
public static void EnableCommit ()
public:
static void EnableCommit ()
public static void EnableCommit ()
public static function EnableCommit ()

Ausnahmen

Ausnahmetyp Bedingung

COMException

Es ist kein COM+-Kontext verfügbar.

Hinweise

Auf Aufforderung führt der COM+-Kontext einen Commit für die aktuelle Transaktion aus, das Objekt wird jedoch bei Beenden der Methode nicht deaktiviert.

Beispiel

Im folgenden Codebeispiel wird die EnableCommit-Methode aufgerufen.

<Transaction(TransactionOption.Required)>  _
Public Class ContextUtil_EnableCommit
    Inherits ServicedComponent
    
    Public Sub Example() 
        ' Set the consistent bit to true and the done bit to false for the
        ' current COM+ context.
        ContextUtil.EnableCommit()
    
    End Sub 'Example
End Class 'ContextUtil_EnableCommit
[Transaction(TransactionOption.Required)]
public class ContextUtil_EnableCommit : ServicedComponent
{
    public void Example()
    {
        // Set the consistent bit to true and the done bit to false for the
        // current COM+ context.
        ContextUtil.EnableCommit();
    }
}
[Transaction(TransactionOption::Required)]
public ref class ContextUtil_EnableCommit: public ServicedComponent
{
public:
   void Example()
   {
      // Set the consistent bit to true and the done bit to false for the
      // current COM+ context.
      ContextUtil::EnableCommit();
   }
};
/** @attribute Transaction(TransactionOption.Required)
 */
public class ContextUtil_EnableCommit extends ServicedComponent
{
    public void Example()
    {
        // Set the consistent bit to true and the done bit to false for the
        // current COM+ context.
        ContextUtil.EnableCommit();
    } //Example
} //ContextUtil_EnableCommit

.NET Framework-Sicherheit

  • Volle Vertrauenswürdigkeit für den unmittelbaren Aufrufer. Dieser Member kann von nur teilweise vertrauenswürdigem Code nicht verwendet werden. Weitere Informationen finden Sie unter .

Plattformen

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

ContextUtil-Klasse
ContextUtil-Member
System.EnterpriseServices-Namespace