Google

DbLockNotGrantedException

APIRef

#include <db_cxx.h>

class DbLockNotGrantedException : public DbException { public: db_lockop_t get_op() const; db_lockmode_t get_mode() const; const Dbt* get_obj() const; DbLock *get_lock() const; int get_index() const; };

Description

This manual page describes the DbLockNotGrantedException class and how it is used by the various Db* classes.

A DbLockNotGrantedException is thrown when a lock, requested using the DbEnv::lock_get or DbEnv::lock_vec methods (where the DB_LOCK_NOWAIT option was specified), or by any Db operation performed in the context of a transaction begun using the DB_TXN_NOWAIT option, is unable to be granted immediately.

The get_op method returns 0 when DbEnv::lock_get was called, and returns the op for the failed DB_LOCKREQ when DbEnv::lock_vec was called.

The get_mode method returns the mode argument when DbEnv::lock_get was called, and returns the mode for the failed DB_LOCKREQ when DbEnv::lock_vec was called.

The get_obj method returns the obj argument when DbEnv::lock_get was called, and returns the obj for the failed DB_LOCKREQ when DbEnv::lock_vec was called. The Dbt pointer may or may not refer to valid memory, depending on whether the Dbt used in the call to the failed DbEnv::lock_get or DbEnv::lock_vec method is still in scope and has not been deleted.

The get_lock method returns NULL when DbEnv::lock_get was called, and returns the lock in the failed DB_LOCKREQ when DbEnv::lock_vec was called.

The get_index method returns -1 when DbEnv::lock_get was called, and returns the index of the failed DB_LOCKREQ when DbEnv::lock_vec was called.

APIRef

Copyright Sleepycat Software