gtpc2m77C/C++ Language Support User's Guide

tancc-Transaction Anchor Table Control

This function provides the interface to access the transaction anchor table (TANC). It permits an application program to add, remove, or locate a transaction manager control record (TMCR) from the transaction anchor table.

Format

#include   <tpfapi.h>
int         tancc(enum t_tancc action, TMCR **, GTRID *);

action
The type of transaction anchor table control (TANCC) requested. This argument must belong to the enumeration type t_tancc, which is defined in the c$tmcr.h header file.

TANCC_ADD
Adds the pointer of a transaction manager control record (TMCR) to the transaction anchor table (TANC).

TANCC_DELETE
Removes the pointer to a TMCR from the TANC.

TANCC_LOCATE
Locates the pointer to a TMCR with the matching transaction ID (TID).

TMCR
A pointer to a TMCR. For a TANCC_ADD or TANCC_DELETE request, it is the input parameter. For a TANCC_LOCATE request, it is the output parameter.

GTRID
A pointer to a global transaction ID. This pointer is used only for the TANCC_LOCATE request.

Normal Return

Table 17. tancc Normal Return

Value Name Return Code Description
TANCC_OK 0 The function is completed successfully.

Error Return

Table 18. tancc Error Return

Value Name Return Code Description
TANCC_INVAL_ACTION -1 The action parameter is incorrect.
TANCC_INVAL_TMCR -2 The required TMCR parameter is null.
TANCC_INVAL_TID -3 The required transaction ID (TID) parameter is null.
TANCC_DUPLICATE_TID -4 A TMCR with the same TID is found in the TANC during a TANCC_ADD process.
TANCC_TID_NOT_FOUND -5 A TMCR with a corresponding TID was not found during the TANCC_DELETE or TANCC_LOCATE process.

Programming Considerations

Examples

The following example shows a normal commit scope.

#include <tpfapi.h>

  ·
  ·
  ·
{ TMCR *tmcr; GTRID *tid; if ( tancc(TANCC_LOCATE, &tmcr, tid) == TANCC_OK) { /* TMCR is located and pointer is stored in tmcr */
  ·
  ·
  ·
} else {
  ·
  ·
  ·
} }

Related Information

None.