import com.sleepycat.db.*;public void get(DbLsn lsn, Dbt data, int flags) throws DbException;
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.DB_DBT_MALLOC or Db.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 log is empty, the DbLog.get method will return DB_NOTFOUND.
If the log is empty, the DbLog.get method will return DB_NOTFOUND.
If the log is empty, the DbLog.get method will return DB_NOTFOUND.
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.
If the log pointer has not been initialized via DB_FIRST, DB_LAST, DB_SET,
DB_NEXT, or DB_PREV, or if the log was opened with the DB_THREAD flag set,
DbLog.get will return EINVAL.
Otherwise, the DbLog.get method throws an exception that encapsulates an errno on failure.
The DbLog.get method may fail and throw an exception for any of the errors specified for the following Berkeley DB and C library functions: abort(3), atoi(3), close(3), closedir(3), fcntl(3), fflush(3), fprintf(3), free(3), getenv(3), getpid(3), getuid(3), isdigit(3), lseek(3), malloc(3), memcpy(3), memset(3), open(3), opendir(3), read(3), readdir(3), realloc(3), sigfillset(3), sigprocmask(3), snprintf(3), stat(3), strchr(3), strerror(3), strlen(3), strncmp(3), unlink(3), vfprintf(3), and vsnprintf(3).
In addition, the DbLog.get method may fail and throw an exception encapsulating errno for the following conditions:
The DB_FIRST flag was specified and no log files were found.