Library Version 12.1.6.0

DbEnv::set_lk_priority()
Prev | Chapter 7. The DbLock Handle | Next

## DbEnv::set_lk_priority()

    #include <db_cxx.h>

    int
    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.

### Parameters

#### lockerid

The lockerid parameter represents a locker returned by `DbEnv::lock_id()`.

#### priority

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

### Errors

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:

#### EINVAL

An invalid flag value or parameter was specified.

### Class

DbEnv, DbLock

### See Also

Locking Subsystem and Related Methods

Prev | Up | Next
DbEnv::set_lk_partitions() | Home | DbEnv::set_lk_tablesize()