gtpc2m77 | C/C++ Language Support User's Guide |
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 *);
Normal Return
Value Name | Return Code | Description |
---|---|---|
TANCC_OK | 0 | The function is completed successfully. |
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
In the case of a log takeover, there will be more than one transaction anchor table in the system. The tancc function will use a processor index value that is kept in the TMCR (for TANCC_ADD or TANCC_DELETE) or in the entry control block (ECB) (for TANCC_LOCATE) to perform the function on the correct transaction anchor table.
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