pyqldb.session.pooled_qldb_session.
PooledQldbSession
(qldb_session, return_session_to_pool)[source]¶Represents a pooled session object. See pyqldb.session.qldb_session
for more details.
execute_lambda
(query_lambda, retry_indicator=<function PooledQldbSession.<lambda>>)[source]¶Calls pyqldb.session.qldb_session.QldbSession.execute_lambda()
to implicitly start a transaction,
execute the lambda function, and commit the transaction, retrying up to the retry limit if an OCC conflict or
retriable exception occurs.
If an InvalidSessionException is received, it is considered a retriable exception by starting a new
pyqldb.communication.session_client.SessionClient
to use to communicate with QLDB. Thus, as a side
effect, this QldbSession can become valid again despite a previous InvalidSessionException from other method
calls on this instance, any child transactions, or cursors, when this method is invoked.
query_lambda (function) – The lambda function to execute. A lambda function cannot have any side effects as it may be invoked multiple times, and the result cannot be trusted until the transaction is committed.
retry_indicator (function) – Optional function called when the transaction execution is about to be retried due to an OCC conflict or retriable exception.
The return value of the lambda function which could be a
pyqldb.cursor.buffered_cursor.BufferedCursor
on the result set of a statement within the
lambda.
IllegalStateError – When the commit digest from commit transaction result does not match.
SessionClosedError – When this session is closed.
ClientError – When there is an error communicating with QLDB.
execute_statement
(statement, parameters=[], retry_indicator=<function PooledQldbSession.<lambda>>)[source]¶Calls pyqldb.session.qldb_session.QldbSession.execute_statement()
to implicitly start a transaction,
execute the statement, and commit the transaction, retrying up to the retry limit if an OCC conflict or
retriable exception occurs.
If an InvalidSessionException is received, it is considered a retriable exception by starting a new
pyqldb.communication.session_client.SessionClient
to use to communicate with QLDB. Thus, as a side
effect, this QldbSession can become valid again despite a previous InvalidSessionException from other method
calls on this instance, any child transactions, or cursors, when this method is invoked.
statement (str) – The statement to execute.
parameters (list) – Optional list of Ion values to fill in parameters of the statement.
retry_indicator (function) – Optional function called when the transaction execution is about to be retried due to an OCC conflict or retriable exception.
Fully buffered Cursor on the result set of the statement.
IllegalStateError – When the commit digest calculated by the client does not match the digest as calculated by the QLDB service.
SessionClosedError – When this session is closed.
ClientError – When there is an error communicating with QLDB.
ledger_name
¶The read-only ledger name.
list_tables
()[source]¶Get the list of table names in the ledger.
Iterable of table names in amazon.ion.simple_types.IonPyText format found in the ledger.
SessionClosedError – When this session is closed.
session_token
¶The read-only session token.
start_transaction
()[source]¶Start a transaction using an available database session.
A new transaction.
SessionClosedError – When this session is closed.