Freigeben über


ContextUtil.DisableCommit-Methode

Legt sowohl das consistent-Bit als auch das done-Bit im COM+-Kontext auf false fest.

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

Syntax

'Declaration
Public Shared Sub DisableCommit
'Usage

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

Ausnahmen

Ausnahmetyp Bedingung

COMException

Es ist kein COM+-Kontext verfügbar.

Hinweise

Auf Aufforderung fordert der COM+-Kontext an, die aktuelle Transaktion abzubrechen. Das Objekt wird bei Beenden der Methode jedoch nicht deaktiviert.

Beispiel

Im folgenden Codebeispiel wird die DisableCommit-Methode aufgerufen.

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

.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