DbLog::get

#include <db_cxx.h>

int
DbLog::get(DbLsn *lsn, Dbt *data, u_int32_t flags);

Description

The DbLog::get method implements a cursor inside of the log,
retrieving records from the log according to the lsn and
flags arguments.

The data field of the data structure is set to the record retrieved
and the size field indicates the number of bytes in the record.
See Dbt for a description of other fields in the data
structure.
When multiple threads are using the returned log handle concurrently,
either the DB_DBT_MALLOC or DB_DBT_USERMEM flags must
be specified for any Dbt used for data retrieval.

The flags argument must be set to exactly one of the following values:

If the pointer has not been initialized via DB_FIRST, DB_LAST, DB_SET,
DB_NEXT, or DB_PREV, DbLog::get will return the first record in the log.
If the last log record has already been returned or the log is empty, the
DbLog::get method will return DB_NOTFOUND.

If the log was opened with the DB_THREAD flag set, calls to
DbLog::get with the DB_NEXT flag set will return EINVAL.

If the pointer has not been initialized via DB_FIRST, DB_LAST, DB_SET,
DB_NEXT, or DB_PREV,
DbLog::get will return the last record in the log.
If the first log record has already been returned or the log is empty, the
DbLog::get method will return DB_NOTFOUND.

If the log was opened with the DB_THREAD flag set, calls to
DbLog::get with the DB_PREV flag set will return EINVAL.

Otherwise, the DbLog::get
method either returns errno or throws an exception that
encapsulates an errno on failure, and 0 on success.

Errors

If a fatal error occurs in Berkeley DB, the DbLog::get method may fail and either
return DB_RUNRECOVERY or throw an exception encapsulating DB_RUNRECOVERY,
at which point all subsequent database calls will also fail in the same
way. Methods marked as returning errno will, by default, throw
an exception that encapsulates the error information. The default error
behavior can be changed, see DbException.