Compensator.AbortRecord Method (LogRecord)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Delivers a log record to the Compensating Resource Manager (CRM) Compensator during the abort phase.

Namespace:   System.EnterpriseServices.CompensatingResourceManager
Assembly:  System.EnterpriseServices (in System.EnterpriseServices.dll)

public virtual bool AbortRecord(
	LogRecord rec


Type: System.EnterpriseServices.CompensatingResourceManager.LogRecord

The log record to be delivered.

Return Value

Type: System.Boolean

true if the delivered record should be forgotten; otherwise, false.

The following code example demonstrates the implementation of this method.

public override bool AbortRecord (LogRecord log)

    // Check the validity of the record.
    if (log == null) return(true);
    Object[] record = log.Record as Object[];
    if (record == null) return(true);
    if (record.Length != 2) return(true);

    // Extract old account data from the record.
    string filename = (string) record[0];
    int balance = (int) record[1];

    // Restore the old state of the account.
    AccountManager.WriteAccountBalance(filename, balance);


.NET Framework
Available since 1.1
Return to top