Clerk.ForceLog 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
強制所有記錄檔資料錄儲存到磁碟。
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 會讓已寫入磁碟上持久的所有記錄檔記錄。