DSI Database Trace Tool

The DSI Database Trace tool is a managed database interface that records the internal commands PowerBuilder executes while accessing a database.

Use the DSI Database Trace tool in PowerBuilder .NET WPF applications to trace DSI database connections at runtime. Unless you use the PBADO driver, the DSI data source interface calls the DBI database interface to connect to a database. This, in turn, activates the DBI Database Trace tool to trace the DBI database connections, although you can disable DBI tracing through a DSI parameter setting.

Enabling the DSI Database Trace tool

Enable DSI tracing in WPF applications by adding "tra" followed by a blank space before the assignment of the transaction object DBMS. For example:
              SQLCA.DBMS = "TRA ODBC"

The DSI Database Trace tool writes the output of the DSI trace to a log file that you specify in a DSI parameter setting. When you initially enable DSI or DBI database tracing, PowerBuilder creates the log file on your computer. Tracing continues until you disconnect from the database.

At design time, you can use only DBI tracing. See the PowerBuilder Classic Users Guide.

Parameters of the DSI database trace

Set the DSI Database Trace tool parameters in a DSITrace section of the configuration file for your application. The DSITrace section must also include a type parameter set to "Sybase.PowerBuilder.DataSource.DSITraceConfig, Sybase.PowerBuilder.DataSource,Version=12.0.0.0, Culture=neutral, PublicKeyToken=598c7456a83d557a".

Note: The DSITrace section with the required type parameter is automatically generated in the application configuration file at deployment time, but is commented out. You can uncomment this section when you set parameters for DSI tracing in the configuration file.

This table describes parameters you can set for DSI tracing in a DSITrace element after the configSections tag in the application configuration file.

Parameter Description
fileName

Name and location of the trace log file. If you do not specify a full path name, the log file is saved in the current directory. If you do not use this parameter, the DSI trace file is not generated.

disableDBITrace (optional)
Set or cancel DBI tracing when DSI tracing is enabled. This parameter is not valid for PBADO drivers. Values are:
  • 0 – (default) DBI tracing is enabled.
  • 1 – DBI tracing is disabled.
showParameters (optional)
Include or exclude SQL command parameters in the DSI trace log file. Values are:
  • 0 – (default) SQL command parameters are not included in the log file.
  • 1 – SQL command parameters are included in the log file.
showFetchData (optional)
Include or exclude data from fetch buffers in the DSI trace log file. Values are:
  • 0 – (default) Fetch data is not included in the log file.
  • 1 – Fetch data is included in the log file.

Configuration file example

The following settings in an application configuration file disable DBI tracing, cause the DSI trace to include SQL command parameters and fetch data in its log file, and save the log file to the root directory on the c: drive with the default DSITRACE.LOG file name:
           <?xml version="1.0" encoding="utf-8" ?> 
            <configuration>
           <configSections>
            <section name="DSITrace"
                  type="Sybase.PowerBuilder.              
                           DataSource.DSITraceConfig, Sybase.
                           PowerBuilder.DataSource,Version=12.0.0.0, 
                           Culture=neutral, PublicKeyToken=598c7456a83d557a"  />
             </configSections>
            ...
            <DSITrace fileName="c:\dsitrace.log"  disableDBITrace="1" 
                            showParameters="1"   showFetchData="1" />                         
             ...
              </configuration>
  

Trace file contents

The log file that you generate with the DSI Database Trace tool lists information from commands of three object types: DSConnection, DSCommand, and DSReader. The log file also lists SQL commands and data from fetch buffers if you enabled those options in the configuration file.

The format for the DSI command information is as follows, where tID is the thread ID, objID is a random 8-digit number for the DSObject, DSObject is DSConnection, DSCommand, or DSReader, and commandIssued is the name of the command. The starting time for the command is given to the second, and the duration of the command is given in milliseconds (MS):
    (tID.objID) DSObject.commandIssued() MM/DD/YYYY HR:MIN:SEC / #### MS