The mi_get_transaction_id() function

The mi_get_transaction_id() function obtains the current internal transaction ID.

Syntax

mi_integer mi_get_transaction_id(void); 
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_get_transaction_id() function obtains the internal transaction ID of the current transaction. This transaction ID is not the same as the thread ID or the session ID. If mi_get_transaction_id() is called while not inside a transaction or with a non-logging database, it returns MI_ERROR. The value of the MI_ERROR -1.

Return values

>0
A transaction ID.
-1
indicates no transaction