Nonstop Database, HiRDB Version 9 UAP Development Guide

[Contents][Index][Back][Next]

11.1.2 Client error log facility

When an error occurs during communication between a client and the HiRDB server or in the XA interface specified by X/Open, error information is collected as a client error log in a client error log file.

When the current client error log file becomes full, a new file is swapped in and the oldest information in that file is overwritten.

Organization of this subsection
(1) How to collect client error log information
(2) How to interpret the client error log information
(3) Making a backup of a client error log file

(1) How to collect client error log information

You can collect client error logs by specifying appropriate values in PDCLTPATH and PDUAPERLOG in the client environment definitions. For details about client environment definition, see 6.6 Client environment definitions (setting environment variables).

The two client error log files in which information is to be collected are created under a specified directory. The files that are created depend on whether or not an X/Open-compliant API (TX_function) is used.

The following table shows the relationship between use of an X/Open-compliant API (TX_ function) and the error log files that are created.

Table 11-3 Relationship between use of an X/Open-compliant API (TX_ function) and error log files that are created

Use of TX_function Client error log files that are created
No pderr1.trc and pderr2.trc
Yes pderrxxxxx-1.trc and pderrxxxxx-2.trc

xxxxx: Process ID during UAP execution

(2) How to interpret the client error log information

Client error log information is output whenever an error occurs during SQL statement execution, during communication, and during execution of an X/Open-compliant XA interface function.

An example of client error log information that is output is shown below, followed by an explanation of the output items.

Output example
[Figure]
  1. Client error log lead identifier: >> is displayed for an error that occurred during SQL execution; > is displayed for any other error.
  2. UAP process number: Displays the process number of the UAP where the error occurred. If the correct process number cannot be obtained, an invalid value may be displayed (Windows).
  3. UAP thread number: Displays the UAP thread number when the UAP in which the error occurred is running in a multi-thread environment. Displays 0 if the UAP is not running in a multi-thread environment. The correct thread number cannot be assigned, and an invalid numeric value can sometimes be displayed as a result.
  4. Server process number: Displays the process number at the server that is connected.
  5. Client error log counter: Displays a value provided by the error log counter. Each time error log information is accepted, the counter value is incremented by 1 (from 0 through 65535).
  6. Collection date and time: Displays the date and time the client error log information was collected (in YYYY/MM/DD HH:MM:SS format).
  7. Log data: Displays the error information (error message).
  8. SQLCODE: Displays the SQLCODE when the client error log is for an SQLCODE that is to be returned to the UAP.
  9. SQL counter: Displays the SQL counter value for the SQL statement in which the error occurred. If the SQL counter value consists of more than five digits, only the five leading digits are displayed. For details about the SQL counter, see the output example explanation in Section 11.1.1 SQL tracing.
  10. Error collection time: Displays (in milliseconds) the amount of time used to collect the client error log information.
  11. Error detection location: Displays the name of the source file and the row number where the error was detected.
  12. Operation code: Displays the operation code of the SQL statement in which the error occurred.

(3) Making a backup of a client error log file

If the client error log file becomes full while client error log information is being output, HiRDB stops writing to that file and resumes output of client error log information to the other client error log file. Any information that already exists in the switched-in client error log file is overwritten (beginning with the oldest information) by the new client error log information. To prevent information from being lost by overwriting, you should copy the contents of the client error log file into a backup file whenever execution of a UAP is completed.

To determine the client error log file that is being used currently, check the most recent update dates/times of files. The client error log file that was updated most recently is the current file.

For a Windows edition HiRDB client, you use the dir command or the Explorer to check the file update dates/times.

For a UNIX edition HiRDB client, you use the OS's 1s -1 command to check the file update dates/times.