Bagikan melalui


Clerk.ForceLog Metode

Definisi

Memaksa semua rekaman log ke disk.

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

Contoh

Contoh kode berikut menunjukkan penggunaan metode ini.

// 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()

Keterangan

Compensator Compensating Resource Manager (CRM) dan CRM menggunakan metode ini untuk menulis rekaman dengan malas ke log, yang berarti mereka tidak dibuat tahan lama sampai mereka dipaksa ke log. Panggilan ForceLog membuat semua catatan log yang telah ditulis tahan lama pada disk.

Berlaku untuk