แก้ไข

แชร์ผ่าน


Clerk.ForceLog Method

Definition

Forces all log records to disk.

public:
 void ForceLog();
public void ForceLog ();
member this.ForceLog : unit -> unit
Public Sub ForceLog ()

Examples

The following code example demonstrates the use of this method.

// Create a record of previous account status, and deliver it to the
// clerk.
int balance = ReadAccountBalance(Filename);

array<Object^>^ record = gcnew array<Object^>(2);
record[0] = Filename;
record[1] = balance;

clerk->WriteLogRecord(record);
clerk->ForceLog();
    // Create a record of previous account status, and deliver it to the clerk.
    int balance = AccountManager.ReadAccountBalance(filename);

Object[] record = new Object[2];
record[0] = filename;
    record[1] = balance;

    clerk.WriteLogRecord(record);
    clerk.ForceLog();
' Create a record of previous account status, and deliver it to the clerk.
Dim balance As Integer = AccountManager.ReadAccountBalance(Filenam)

Dim record(1) As [Object]
record(0) = filename
record(1) = balance

clerk.WriteLogRecord(record)
clerk.ForceLog()

Remarks

The Compensating Resource Manager (CRM) Worker and CRM Compensator use this method to write records lazily to the log, which means they are not made durable until they have been forced to the log. Calling ForceLog makes all log records that have been written durable on disk.

Applies to