TxnStatus

Outcome of a multi-record transaction’s commit or abort.

class aerospike_sdk.txn_status.TxnStatus[source]

Bases: Enum

Outcome of TransactionalSession.commit() or TransactionalSession.abort().

A successful commit returns COMMITTED, a successful abort ABORTED. The *_ABANDONED members are also successful outcomes whose cleanup the server finishes on its own; a failure that leaves writes provisional raises CommitError instead of returning a status.

Example:

async with session.transaction() as tx:
    await tx.upsert(accounts.id("alice")).bin("balance").add(-250).execute()
    await tx.upsert(accounts.id("bob")).bin("balance").add(250).execute()
    status = await tx.commit()

if status is TxnStatus.ROLL_FORWARD_CLOSE_ABANDONED:
    log.info("committed; the server will finish closing the transaction")
COMMITTED = 'committed'

Commit succeeded.

ABORTED = 'aborted'

Abort succeeded.

ALREADY_COMMITTED = 'already_committed'

The transaction was already committed.

ALREADY_ABORTED = 'already_aborted'

The transaction was already aborted.

ROLL_FORWARD_CLOSE_ABANDONED = 'roll_forward_close_abandoned'

The transaction was rolled forward, but closing it was abandoned.

The writes are durable; the server will eventually close the transaction.

ROLL_BACK_ABANDONED = 'roll_back_abandoned'

The client abandoned the roll back; the server will eventually abort the transaction.

ROLL_BACK_CLOSE_ABANDONED = 'roll_back_close_abandoned'

The transaction was rolled back, but closing it was abandoned.

The server will eventually close the transaction.