lrt_tpgetlev

Transaction Handling Functions

Checks if a transaction is in progress.

int lrt_tpgetlev( ) ;

The lrt_tpgetlev function checks if a transaction is in progress.

Return Values

If the function succeeds, it returns the current transaction level: 0 if no transaction is in progress or 1 of a transaction is in progress. If the function ends with an error, it returns -1 and sets the error code in tperrno.

Parameterization

Parameterization is not applicable to this function.

Example

In the following example, the lrt_tpgetlev function checks if a transaction is in progress.

The first and third calls to lrt_tpgetlev return 0, since a Tuxedo transaction is not in progress. The second call returns 1, since a transaction is in progress.

Copy code
rc = lrt_tpgetlev();
lrt_tpbegin(30, 0);
rc = lrt_tpgetlev();
lrt_tpcommit(0);
rc = lrt_getlev();