TLog_Checkpoint

This sample demonstrates the use of the log option MCO_TRANSLOG_SIZE_CLBK, which enables a warning via a user-defined callback when the specified log file size has been reached.

The sample application sets up the log file size limit and a user-defined callback that signals when the limit has been reached. The main application loop performs database transactions. If the size callback has been called, the main loop pauses, then saves a database snapshot using the special function mco_translog_db_save. This function saves a database snapshot and truncates the transaction log in a single thread-safe operation.

How to Run

See instructions here on how to build this and other samples on your development platform. Once built, the sample can be run from the \target\bin directory:

    tlogcheckpoint

But it is more instructive to run it in your development environment debugger, stepping through the code.

Related Topics Link IconRelated Topics