#include <db_cxx.h>

DbEnv::set_lk_priority(u_int32_t u_int32_t lockerid, u_int32_t priority); 

Set the priority of the given locker. This value is used when resolving deadlocks, the deadlock resolution algorithm will reject a lock request from a locker with a lower priority before a request from a locker with a higher priority.

By default, all lockers are created with a priority of 100.

The DbEnv::set_lk_priority() method may be called at any time during the life of the application.

The DbEnv::set_lk_priority() 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 lockerid parameter represents a locker returned by DbEnv::lock_id().


The priority parameter must be a value between 0 and 2^32-1.


The DbEnv::set_lk_priority() method may fail and throw a DbException exception, encapsulating one of the following non-zero errors, or return one of the following non-zero errors:


An invalid flag value or parameter was specified.


DbEnv, DbLock

See Also

Locking Subsystem and Related Methods