)I'Berkeley DB: DbLock::put[P

DbLock::put





#include <db_cxx.h>

intDbLock::put(DbLockTab *lt);





Description



qThe DbLock::put method is a simple interface to the DbLockTab::vecfunctionality.

zIt is equivalent to calling the DbLockTab::vec method with a single elementGlist array, for which the op field is DB_LOCK_PUT and thedlock field is represented by the DbLock object.CThe DbLock::put method returns success and failure as described forIthe DbLockTab::vec method.

FIf a process dies while holding locks, those locks remain held and areBnever released. In this case, all processes should exit as:quickly as possible, so that database recovery can be run.



Errors

RIf a fatal error occurs in Berkeley DB, the DbLock::put method may fail and eitherIreturn DB_RUNRECOVERY or throw an exception encapsulating DB_RUNRECOVERY,Gat which point all subsequent database calls will also fail in the sameFway. Methods marked as returning errno will, by default, throwHan exception that encapsulates the error information. The default error\behavior can be changed, see DbException.

The DbLock::put&method may fail and throw an exceptionKfor 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),DDbLockTab::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 exceptionor return errnofor the following conditions:

L

EACCES
An attempt was made to release lock held by another locker.


B

EINVAL
An invalid flag value or parameter was specified.







Class

4DbLock



See Also

DbLock::put
ÿÿ