PURPOSE

tpgetlev - routine for checking if a transaction is in progress

SYNOPSIS

#include <atmi.h>
int tpgetlev()		

DESCRIPTION

tpgetlev() returns to the caller the current transaction level. Currently, the only levels defined are 0 and 1.

RETURN VALUES

Upon successful completion, tpgetlev() returns either a 0 to indicate that no transaction is in progress, or 1 to indicate that a transaction is in progress; otherwise, tpgetlev() returns -1 on error and sets tperrno to indicate the error condition.

ERRORS

Under the following conditions, tpgetlev() fails and sets tperrno to:

[TPEPROTO]
tpgetlev() was called in an improper context.
[TPESYSTEM]
A System/T error has occurred. The exact nature of the error is written to a log file.
[TPEOS]
An operating system error has occurred.

NOTICES

When using tpbegin(3c), tpcommit(3c) and tpabort(3c) to delineate a System/T transaction, it is important to remember that only the work done by a resource manager that meets the XA interface (and is linked to the caller appropriately) has transactional properties. All other operations performed in a transaction are not affected by either tpcommit(3c) or tpabort(3c). See buildserver(1) for details on linking resource managers that meet the XA interface into a server such that operations performed by that resource manager are part of a System/T transaction.

SEE ALSO

tpabort(3c),
tpbegin(3c),
tpcommit(3c),
tpscmt(3c)