DbTxn::set_priority()
Prev | Chapter 13. The DbTxn Handle | Next

## DbTxn::set_priority()

    #include <db_cxx.h>

    int
    DbTxn::set_priority(u_int32_t priority);

The `DbTxn::set_priority()` method sets the priority for the transaction. The deadlock detector will reject lock requests from lower priority transactions before those from higher priority transactions.

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

The `DbTxn::set_priority()` method may be called at any time during the life of the transaction.

The `DbTxn::set_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

#### priority

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

### Errors

The `DbTxn::set_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, DbTxn

### See Also

Transaction Subsystem and Related Methods

Prev | Up | Next
DbTxn::set_name() | Home | DbTxn::set_timeout()