DbEnv::lock_vec |
#include <db_cxx.h>int DbEnv::lock_vec(u_int32_t locker, u_int32_t flags, DB_LOCKREQ list[], int nlist, DB_LOCKREQ **elistp);
The DbEnv::lock_vec method atomically obtains and releases one or more locks from the lock table. The DbEnv::lock_vec method is intended to support acquisition or trading of multiple locks under one lock table semaphore, as is needed for lock coupling or in multigranularity locking for lock escalation.
The locker argument specified to DbEnv::lock_vec is an unsigned 32-bit integer quantity. It represents the entity requesting or releasing the lock.
The flags value must be set to 0 or the following value:
The list array provided to DbEnv::lock_vec is typedef'd as DB_LOCKREQ. A DB_LOCKREQ structure has at least the following fields, which must be initialized before calling DbEnv::lock_vec:
The nlist argument specifies the number of elements in the list array.
If any of the requested locks cannot be acquired, or any of the locks to be released cannot be released, the operations before the failing operation are guaranteed to have completed successfully, and DbEnv::lock_vec returns a non-zero value. In addition, if elistp is not NULL, it is set to point to the DB_LOCKREQ entry that was being processed when the error occurred.
The DbEnv::lock_vec method may return or throw an exception encapsulating one of the following values:
Otherwise, the DbEnv::lock_vec method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.
The DbEnv::lock_vec method may fail and throw an exception or return a non-zero error for the following conditions:
The DbEnv::lock_vec method may fail and throw an exception or return a non-zero error for errors specified for other Berkeley DB and C library or system methods. If a catastrophic error has occurred, the DbEnv::lock_vec method may fail and either return DB_RUNRECOVERY or throw an exception encapsulating DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail in the same way.