Scalable Database Server, HiRDB Version 8 UAP Development Guide

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

10.1.2 Error logging

If 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 an error log in an error log file.

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

Organization of this subsection
(1) Collecting error log information
(2) Interpreting an error log
(3) Making a backup of an error log file

(1) Collecting error log information

An error log can be collected by setting values in the PDCLTPATH and PDUAPERLOG environment variables during client environment definition. For details about client environment definition, see 6.6 Client environment definitions (setting environment variables).

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

Table 10-2 shows the relationship between the use of an API (TX_function) conforming to X/Open and the error log file that is created.

Table 10-2 Relationship between use of API (TX_function) conforming to X/Open and created error log files

Use of TX_function Created error log files
No pderr1.trc and pderr2.trc
Yes pderrxxxxx-1.trc and pderrxxxxx-2.trc

xxxxx: Process ID during UAP execution

(2) Interpreting an error log

Error log information is output when an error occurs during SQL execution, during communication, or during execution of an XA interface function specified by X/Open. An example of output of error log information is shown as follows, followed by an explanation.

Output example
[Figure]
  1. Error log leading 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. Error log counter: Displays the error log counter values. Each time error log information is accepted, the counter value is incremented (from 0 through 65535).
  6. Collection date and time: Displays the date and time at which the 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 error log corresponds to an SQLCODE to be returned to the UAP.
  9. SQL counter: Displays the SQL counter value for the SQL statement in which the error occurred. For details about the SQL counter, see the output example explanation in Section 10.1.1 SQL tracing.
  10. Error collection time: Displays (in milliseconds) the amount of time used to collect the 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 an error log file

If the error log file becomes full while error log information is being output, HiRDB stops writing to that file and outputs error log information to another error log file. Any information that already exists in the switched-in error log file is overwritten in chronological order by the new error log information. To prevent that information from being lost, copy the contents of the error log file into a backup file whenever execution of a UAP is completed.

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

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

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