Create a Transaction.
The Communicator object representing a communication channel with QLDB.
The ID of the transaction.
Mark the transaction as closed.
Helper method to execute statement against QLDB.
A statement to execute against QLDB as a string.
An optional list of Ion values or JavaScript native types that are convertible to Ion for filling in parameters of the statement.
Promise which fulfills with a ExecuteStatementResult object.
Abort this transaction and close child ResultReadable objects. No-op if already closed by commit or previous abort.
Promise which fulfills with void.
Commits and closes child ResultReadable objects.
Promise which fulfills with void.
Execute the specified statement in the current transaction. This method returns a promise which eventually returns all the results loaded into memory.
A statement to execute against QLDB as a string.
Variable number of arguments, where each argument corresponds to a placeholder (?) in the PartiQL query. The argument could be any native JavaScript type or an Ion DOM type. Details of Ion DOM type and JavaScript type
Promise which fulfills with all results loaded into memory
Execute the specified statement in the current transaction. This method returns a promise which fulfills with Readable Stream, which allows you to stream one record at time
A statement to execute against QLDB as a string.
Variable number of arguments, where each argument corresponds to a placeholder (?) in the PartiQL query. The argument could be any native JavaScript type or an Ion DOM type. Details of Ion DOM type and JavaScript type
Promise which fulfills with a Readable Stream
Retrieve the transaction ID associated with this transaction.
The transaction ID.
Generated using TypeDoc
A class representing a QLDB transaction.
Every transaction is tied to a parent (Pooled)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, and thus every transaction should call
Transaction.abort
orTransaction.commit
when it is no longer needed, or when a new transaction is desired from the parent session.An InvalidSessionException indicates that the parent session is dead, and a new transaction cannot be created without a new (Pooled)QldbSession being created from the parent driver.
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.
When an OCC conflict occurs, the transaction is closed and must be handled manually by creating a new transaction and re-executing the desired queries.