Detecting a loop in an application

You can use Db2 Query Monitor to detect a loop within an application that is running on a thread or a Db2 subsystem.

Procedure

  • To detect a loop within an application running on a thread:
    1. Add the THREAD_SQLCODE_DUPLICATES(n) parameter to CQMPARMS, where n is the number of occurrences of a duplicate SQLCODE that Db2 Query Monitor reports for a thread.
    2. Add the THREAD_SQLCODE_DUPLICATES_TIME(n) parameter to CQMPARMS, where n is the number of minutes after which you want Db2 Query Monitor to restart duplicate SQLCODE detection for a thread and can detect SQLCODE loops that might occur at different time points within an interval.
  • To detect a loop within an application running on a Db2 subsystem:
    1. Add the DB2_SQLCODE_DUPLICATES(n) parameter to CQMPARMS, where n is the number of occurrences of a duplicate SQLCODE that Db2 Query Monitor reports for a Db2 subsystem.
    2. Add the DB2_SQLCODE_DUPLICATES_TIME(n) parameter to CQMPARMS, where n is the number of minutes after which you want Db2 Query Monitor to restart duplicate SQLCODE detection for a Db2 subsystem and can detect SQLCODE loops that might occur at different time points within an interval.