,I-Berkeley DB: DbLockTab::detect[P

DbLockTab::detect





#include <db_cxx.h>

int4DbLockTab::detect(u_int32_t flags, u_int32_t atype);





Description



IThe DbLockTab::detect method runs one iteration of the deadlock detector.EThe deadlock detector traverses the lock table, and for each deadlock@it finds, marks one of the participating transactions for abort.

ZThe flags value is specified by logically OR'ing together one or more of thefollowing values:

_

DB_LOCK_CONFLICT
Only run the deadlock detector if a lock conflict has occurred since1the last time that the deadlock detector was run.


FThe atype parameter specifies which transaction to abort in thecase of deadlock.HIt must be set to one of values described for the lk_detect fieldof the:DbEnv object.

ƒThe DbLockTab::detect method is the underlying method used by the db_deadlock utility.~See the db_deadlock utility source code for an example of using DbLockTab::detectin a POSIX 1003.1 environment.

The DbLockTab::detect>method either returns errno or throws an exception that:encapsulates an errno on failure, and 0 on success.



Errors

XIf a fatal error occurs in Berkeley DB, the DbLockTab::detect 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 DbLockTab::detect&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),free(3), fsync(3), getpid(3), lseek(3), malloc(3), memcpy(3), memset(3),mmap(3), munmap(3), shmat(3), shmdt(3), sprintf(3), strerror(3), vfprintf(3), vsnprintf(3),and write(3).



Class

:DbLockTab



See Also

BDbLockTab::close,DbLockTab::detect,>DbLockTab::get,<DbLockTab::id,@DbLockTab::open,?DbLockTab::statCDbLockTab::unlinkand>DbLockTab::vec.
ÿÿ