Application Development Guide

Debugging

You can use the tools described in the following sections for use in debugging your applications. For more information, refer to the Troubleshooting Guide.

Diagnosing a Looping or Suspended application

It is possible that, after you start a query or application, you suspect that it is suspended (it does not show any activity) or that it is looping (it shows activity, but no results are returned to the application). Ensure that you have turned lock timeouts on. In some situations, however, no error is returned. In these situations, you may find the tools described in the Troubleshooting Guide, as well as the Database system monitor snapshot helpful.

One of the functions of the database system monitor that is useful for debugging applications is to display the status of all active agents. To obtain the greatest use from a snapshot, ensure that statement collection is being done before you run the application (preferably immediately after you run DB2START) as follows:

  db2_all "db2 UPDATE MONITOR SWITCHES USING STATEMENT ON"

When you suspect that your application or query is either stalled or looping, issue the following command:

  db2_all "db2 GET SNAPSHOT FOR AGENTS ON database

Refer to the System Monitor Guide and Reference for information on how read the information collected from the snapshot, and for the details of using the database system monitor.


[ Top of Page | Previous Page | Next Page ]