共用方式為


Clerk.ForceLog 方法

定義

強制所有記錄檔資料錄儲存到磁碟。

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

範例

下列程式代碼範例示範如何使用這個方法。

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

備註

Compensating Resource Manager (CRM) Worker 和 CRM Compensator 會使用此方法將記錄延遲寫入記錄檔,這表示在強制記錄到記錄之前,它們不會變成持久。 呼叫 ForceLog 會讓已寫入磁碟上持久的所有記錄檔記錄。

適用於