mco_translog_play_ex

This function reads a specified log file or pipe and, if the log file is “compatible”, iterates its content by calling the user-defined callback and also fires registered events.

For an overview see page TL Applications

Prototype

    MCO_RET mco_translog_play_ex(mco_TL_play_params_h tl_play_params);

Arguments

tl_play_params
The mco_TL_play_params_t structure containing the initialized parameters.

Description

This function is similar to mco_translog_play(), except that it takes a single mco_TL_play_params_t structure argument. The mco_TL_play_params_t structure is initialized by calling mco_translog_play_params_init().

The fields of the structure correspond to parameters of mco_translog_play(), with additional fields including:

    mco_device_t *pipe_device;

The pipe_device is a descriptor of the pipe device to be used by the readers. If the value of pipe_device is NULL, then the transaction logging runtime chooses the first pipe that does not have any connected readers. The same happens when the old-style mco_translog_play() and mco_translog_iterate() APIs are used.

Return Codes

MCO_S_OK
The log file was read successfully.
User-defined code other than MCO_S_OK

As with mco_translog_iterate(), if the user-defined callback returns any value other than MCO_S_OK, this function aborts and returns that code as its own return code. This is the correct way to break the iteration loop if an error condition occurs inside the user-defined iteration callback.

MCO_E_TL_INVAL
Arguments are wrong or incompatible.
MCO_E_TL_NOT_ITERABLE

The log was created without the flag MCO_TRANSLOG_ITERABLE.

MCO_E_TL_LOG_NOT_OPENED
The log file could not be opened.
MCO_E_TL_IO_ERROR
Disk I/O error.
MCO_E_VERS_MISMATCH
The log file is incompatible with the runtime settings or the database version.
MCO_E_TL_INVFORMAT
The log file or pipe data is corrupted.
MCO_S_TL_INVDATA
The log file or pipe was not read completely but some transactions were found, or no end-of-file was found.
MCO_E_TL_PIPE_USED

The pipe is already open in another call to mco_translog_iterate().

MCO_E_TL_PIPE_TERM

Logging was terminated during the previous call to mco_translog_iterate() but was not reinitialized by the writer.

MCO_E_TL_PIPE_LOST
All connections to a pipe were closed and its data was lost before this function was called.
MCO_E_NOMEM
Insufficient memory to complete the operation. Increase the value of mem_size.

Files

Header file:
mcolog.h
Source file:
mcolog.c
Library:
libmcolog.a