Skip to content

get_transaction()

relationalai.api
get_transaction(transaction_id STRING)

A procedure that retrieves the details for the transaction with the specified transaction_id. Use this procedure for logic reasoners. Predictive and prescriptive reasoners use api.get_job() instead. Requires the eng_user application role.

NameTypeDescription
transaction_idSTRINGThe ID of the transaction to retrieve.

A table with the following columns:

ColumnTypeDescription
IDSTRINGThe unique identifier of the transaction.
DATABASE_NAMESTRINGThe name of the RAI Python model from which the transaction was sent.
STATESTRINGThe current state of the transaction.
ABORT_REASONSTRINGThe reason the transaction was aborted, if applicable.
READ_ONLYBOOLEANWhether the transaction is read-only.
CREATED_BYSTRINGThe user who created the transaction.
CREATED_ONTIMESTAMPThe timestamp when the transaction was created.
FINISHED_ATTIMESTAMPThe timestamp when the transaction was completed.
TIMINGSVARIANTTiming data returned for the transaction.
ENGINE_NAMESTRINGThe name of the reasoner that processed the transaction.
TIMEOUT_MSINTThe timeout in milliseconds.
PROGRESSOBJECTProgress data returned for the transaction.

Transactions can have the following states:

StateDescription
CREATEDThe transaction has been accepted but is not yet in the reasoner queue. If it remains in this state, the reasoner’s resources are at capacity. Consider increasing the reasoner size or cancelling the transaction and running it on a different reasoner.
QUEUEDThe transaction is in the reasoner’s queue. If it remains in this state, the reasoner’s concurrency limit has been reached. Wait for the transaction to leave the queue or cancel it and rerun on a different reasoner.
RUNNINGThe transaction is being processed by the reasoner.
CANCELINGThe transaction is being cancelled.
COMPLETEDThe transaction has been successfully processed.
ABORTEDThe transaction was cancelled or aborted due to an error. Check the ABORT_REASON field for more details.

Use the api.get_transaction() procedure to retrieve the details of a transaction:

-- Retrieve the details for the transaction with ID '02c8fa31-1234-5678-90ab-abcdef123456'.
CALL relationalai.api.get_transaction('02c8fa31-1234-5678-90ab-abcdef123456');
/*+--------------------------------------+---------------+-----------+--------------+-----------+--------------------------+-------------------------------+-------------------------------+---------+-------------+------------+----------+
| ID | DATABASE_NAME | STATE | ABORT_REASON | READ_ONLY | CREATED_BY | CREATED_ON | FINISHED_AT | TIMINGS | ENGINE_NAME | TIMEOUT_MS | PROGRESS |
|--------------------------------------+---------------+-----------+--------------+-----------+--------------------------+-------------------------------+-------------------------------+---------+-------------+------------+----------|
| 02c8fa31-1234-5678-90ab-abcdef123456 | MyModel | COMPLETED | NULL | TRUE | john.doe@company.com | 2024-10-28 08:00:12.123 -0700 | 2024-10-28 08:00:19.766 -0700 | NULL | john_doe | NULL | NULL |
+--------------------------------------+---------------+-----------+--------------+-----------+--------------------------+-------------------------------+-------------------------------+---------+-------------+------------+----------+ */

Transaction IDs can be found in the ID column of the api.transactions view. See Manage reasoner jobs for more information on managing transactions.