Transaction Reference

class pyqldb.transaction.transaction.Transaction(session, read_ahead, transaction_id, executor)[source]

A class representing a QLDB transaction. This is meant for internal use only.

Every transaction is tied to a parent QldbSession, meaning that if the parent session is closed or invalidated, the child transaction is automatically closed and cannot be used. Only one transaction can be active at any given time per parent session.

Any unexpected errors that occur within a transaction should not be retried using the same transaction, as the state of the transaction is now ambiguous.

Child Cursor objects will be closed when the transaction is aborted or committed.

  • session (pyqldb.communication.session_client.SessionClient) – The session object representing a communication channel with QLDB.

  • read_ahead (int) – The number of read-ahead buffers used in retrieving results.

  • transaction_id (str) – The ID of a transaction.

  • executor (concurrent.futures.thread.ThreadPoolExecutor) – The executor to be used by the retrieval thread.

property transaction_id

The read-only ID of this transaction.