Library Version 12.1.6.1

DB_TXN->set_priority()
Prev | Chapter 12. The DB_TXN Handle | Next

## DB_TXN->set_priority()

    #include <db.h>

    int
    DB_TXN->set_priority(DB_TXN *tid, u_int32_t priority);

The `DB_TXN->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 `DB_TXN->set_priority()` method may be called at any time during the life of the transaction.

The `DB_TXN->set_priority()` method returns a non-zero error value on failure and 0 on success.

### Parameters

#### priority

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

### Errors

The `DB_TXN->set_priority()` method may fail and return one of the following non-zero errors:

#### EINVAL

An invalid flag value or parameter was specified.

### Class

DB_ENV, DB_TXN

### See Also

Transaction Subsystem and Related Methods

Prev | Up | Next
DB_TXN->set_name() | Home | DB_TXN->set_timeout()