The $ZQGBLMOD function enables an application to determine whether it can safely apply a lost transaction to the database. A lost transaction is a transaction that must be rolled off a database to maintain logical multisite consistency.

The format for the $ZQGBLMOD function is:


$ZQGBLMOD function produces an error if you submit an argument that is not a global variable name.

Internally, $ZQGBLMOD (gvn) compares the GT.M transaction number in the database block in which the global variable name is stored with the value in the Zqgblmod_Trans (and Zqgblmod_Seqno) fields stored in the database file header.

For example, if x is the transaction number of the level-0 database block in which gvn resides, and y is the value of Zqgblmod_Seqno of region reg containing gvn, then the following is true:

If a transaction is a lost transaction that has been rolled back and it is determined that for all the M globals set and killed in the transaction $ZQGBLMOD() is zero (0), it is probably safe to apply the updates automatically. However, this determination of safety can only be made by the application designer and not by GT.M. If the $ZQGBLMOD() is one (1) for any set or kill in the transaction, it is not safe to apply the update.

[Note] Note

The test of $ZQGBLMOD() and applying the updates must be encapsulated inside a GT.M transaction.

Another approach to handling lost transactions would be to store in the database the initial message sent by a client, as well as the outcome and the response, and to reprocess the message with normal business logic. If the outcome is the same, the transaction can be safely applied.

[Note] Note

If restartable batch operations are implemented, lost batch transactions can be ignored since a subsequent batch restart will process them correctly.