gtpc2m4u | C/C++ Language Support User's Guide |
This function indicates to the queue manager that all MQPUT, MQPUT1, and MQGET function calls that have occurred since the last syncpoint are to be backed out. Messages put as part of a unit of work are deleted; messages retrieved as part of a unit of work are reinstated on the queue. This call is available only for remote client programs. For local TPF MQSeries applications, use the tx_rollback function.
Format
#include <cmqc.h> void MQBACK (MQHCONN Hconn, PMQLONG pCompCode, PMQLONG pReason);
If the completion code is MQCC_OK, the reason code is MQRC_NONE, which indicates a normal return.
If the completion code is MQCC_FAILED, see Error Return for the corresponding reason codes.
See MQSeries Application Programming Reference and MQSeries Message Queue Interface Technical Reference for more information about MQSeries data types and parameters.
Normal Return
If the completion code is MQCC_FAILED, the function failed with one of the following reason codes:
Programming Considerations
If the Hconn parameter is not for the local TPF MQSeries queue manager, this MQBACK function call will be sent by TPF MQSeries client support to the remote queue manager for processing. The options supported by the remote queue manager can differ from the options specified for the local TPF MQSeries queue manager.
Examples
The following example backs out a queue.
#include <cmqc.h> MQLONG CompCode; /* completion code */ MQLONG Reason; /* reason code */ MQHCONN Hconn; /* Connection Handle */ /* Hconn from previous MQCONN MQOPEN */ MQBACK (hCon,&CompCode,&Reason); if(Reason == MQRC_NONE) printf("MQBACK successfully issued\n");
Related Information