#include <db_cxx.h>int DbLock::put(DbLockTab *lt);
The DbLock::put method is a simple interface to the DbLockTab::vec functionality.
It is equivalent to calling the DbLockTab::vec method with a single element list array, for which the op field is DB_LOCK_PUT and the lock field is represented by the DbLock object. The DbLock::put method returns success and failure as described for the DbLockTab::vec method.
If a process dies while holding locks, those locks remain held and are never released. In this case, all processes should exit as quickly as possible, so that database recovery can be run.
The DbLock::put method may fail and throw an exception for any of the errors specified for the following Berkeley DB and C library functions: abort(3), fcntl(3), fflush(3), fprintf(3), fsync(3), getpid(3), DbLockTab::detect, lseek(3), memcpy(3), memset(3), mmap(3), munmap(3), shmat(3), shmdt(3), strerror(3), vfprintf(3), vsnprintf(3), and write(3).
In addition, the DbLock::put method may fail and throw an exception or return errno for the following conditions: