Nonstop Database, HiRDB Version 9 UAP Development Guide

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

16.10 Troubleshooting function of HiRDB.NET Data Provider

ADO.NET 2.0-compatible HiRDB.NET Data Provider can collect method traces as troubleshooting information.

Organization of this section
(1) How to collect method traces
(2) Method trace output rules
(3) How to interpret the method trace information
(4) Making a backup of a method trace file

(1) How to collect method traces

You can collect method trace information by specifying appropriate values in the PDCLTPATH and PDDNDPTRACE client environment definitions. For details about the client environment definitions, see 6.6 Client environment definitions (setting environment variables).

(2) Method trace output rules

The following rules apply to method trace output:

(3) How to interpret the method trace information

This subsection shows and explains an example of method trace output.

Header
 
[1][1742][sds01][12345678][HiRDB_Data_Provider20][08.04.0.0]
 1  2     3      4         5                      6

Explanation:
The header is output at the beginning of the file.
  1. Connection number
  2. Connection-target server's process ID
  3. Name of single server or front-end server
  4. UAP's process ID
  5. Trace ID information
  6. HiRDB.NET Data Provider's assembly version

Method trace information
 
[0000000001][E][HiRDBCommand@12345678 ExecuteNonQuery][SID(2)][2008/08/27 1:29:10.123]
 1           2  3            4        5                6       7
 
  [Return=0]
   8
  [nArraySize=10]                          -|
                                            |
        :                                   |-9
                                            |
  [CommandText=INSERT INTO T1 VALUES(100)] -|
 
  [MessageText=KFPA11117-E Number of insert values not equal to number of insert columns] 10
  [SQLCODE=-117] 11
  [SQLWARN=0000] 12
  location Hitachi.HiRDB.native.HiRDBcore.ClearSectionItems()      -|
  location Hitachi.HiRDB.HiRDBConnection.Close()                    |
  location Hitachi.HiRDB.HiRDBConnection.Dispose(Boolean disposing) |-13
  location Hitachi.HiRDB.HiRDBConnection.Finalize()                -|
 

Explanation:
Method trace information is output each time a method is called, a method returns control, a property is set, or a property is acquired.
  1. Thread ID
  2. Access type:
    E: Method call
    R: Return from method
    S: Value setting in property
    G: Acquisition of property value
    The output information depends on the access type, as shown in the following table:
    Access type Call type Argument or property value Return value Error information
    Method E Call Y -- --
    R Return (normal) -- Y --
    Return (error) -- -- Y
    Property S Setting (normal) Y -- --
    Setting (error) Y -- Y
    G Acquisition (normal) -- Y --
    Acquisition (error) -- -- Y
    Legend:
    Y: Output
    --: Not output
  3. Class name. In this example, the provider name is omitted.
  4. Hash code. In this example, an at mark (@) separates the hash code from the class name.
  5. Method name or property name
  6. Section number. For a method or property that has no effect on SQL execution, an asterisk (*) is output because the section number cannot be identified.
  7. Trace collection date and time
  8. Return value. In the event of an exception, the Exception class name is output.
  9. Argument names and values or property names and values. A name and a value are separated by an equal sign (=).
  10. Error message
  11. SQLCODE that resulted from the SQL statement execution.
  12. SQLWARN. This is warning information (displayed in hexadecimal). For details, see 11.1.1(2) Examining SQL trace information.
  13. Stack trace
For some methods, property information is output. The following table shows the output format for each access type:
Access type Caller Format Remarks
Method E HiRDBCommand.Execute
HiRDBCommand.ExecuteDbDataReader
HiRDBCommand.ExecuteNonQuery
HiRDBCommand.ExecuteReader
HiRDBCommand.ExecuteScalar
CommandText=VALUE#1
Parameters.Count=VALUE
PARAMETER_VALUE#2
If there are arguments, the argument information is output.
Other ARGUMENT#3=VALUE --
R HiRDBConnection.Open ConnectionString=VALUE
ServerVersion=VALUE
--
Other Return=VALUE --
Property S -- PROPERTY#4=VALUE --
G -- Return=VALUE --

Legend:
--: Not applicable

#1
VALUE indicates the property value, argument value, or return value that was set or acquired.

#2
PARAMETER_VALUE indicates information about each parameter that has been registered in HiRDBParameterCollection. The information consists of the following:
ParameterName,HiRDBType,Value,Precision,Scale,Repetition

#3
ARGUMENT indicates an argument name.

#4
PROPERTY indicates a property name.

(4) Making a backup of a method trace file

When the capacity of the current method trace file reaches a specified size, the system starts using the other method trace file for output of method trace information. When this occurs, the oldest method trace information in the switched-in method trace file is overwritten by new method trace information. For this reason, you should back up the contents of the method trace file upon termination of a UAP.

To determine which method trace file is being used currently, check the two files' last update dates and times. The file with the most recent update date and time is the current method trace file. Use the dir command or Explorer to check the update dates and times.