relstorage.adapters.txncontrol – TransactionControl implementations

TransactionControl implementations

class AbstractTransactionControl[source]

Bases: object

Abstract base class

commit_phase1(conn, cursor, tid)[source]

Begin a commit. Returns the transaction name.

The transaction name must not be None.

This method should guarantee that commit_phase2() will succeed, meaning that if commit_phase2() would raise any error, the error should be raised in commit_phase1() instead.

commit_phase2(conn, cursor, txn)[source]

Final transaction commit.

txn is the name returned by commit_phase1.

abort(conn, cursor, txn=None)[source]

Abort the commit. If txn is not None, phase 1 is also aborted.

get_tid(cursor)[source]

Returns the most recent tid

add_transaction(cursor, tid, username, description, extension, packed=False)[source]

Add a transaction

class GenericTransactionControl(keep_history, Binary)[source]

Bases: relstorage.adapters.txncontrol.AbstractTransactionControl

A ITransactionControl implementation that works for history-free and history-preserving storages that share a common syntax.