You can still debug by including the TRACE statement in your SPL routine to generate tracing output while the SPL routine runs. For information about how to produce and examine TRACE statement output, check IDS manual for details.
Starting an SPL debugging session with Optim Development Studio
You can examine the runtime behavior of an SPL routine in a client debugging environment and control the flow of a debugging session, using the standard debugger interface of Optim Development Studio (ODS). The steps that follow are also valid for Optim Data Studio.
Note: SPL Routine Debugger support for IDS 11.70 is available in ODS 184.108.40.206 and later versions. Earlier ODS versions (like 2.2.0) supported IDS, but do not provide SPL support nor SPL Routine Debugger support.
To begin an SPL Routine debugging session in ODS, follow these steps:
IDS 11.70 Server instance: Start-up and configuration
To configure the Informix database server instance so that SPL routine debugging is enabled, follow these steps:
- Install the IDS 11.70 product.
- Configure and bring up the IDS 11.70 server with entries in the onconfig and sqlhosts files to support the DRDA communications protocol:
ids_spldb drsoctcp ids_server_machine_name port_number
- Note: SPL Routine Debugger support for IDS 11.70 connects the server to the client via the IBM Data Server Driver for JDBC and SQLJ, and requires an Informix DRDA protocol connection.
- You must provide an sbspace where the database server can store XML messages that ODS sends to the server. The setting of the SBSPACENAME configuration parameter specifies the name of the system default sbspace. You can create a default sbspace on the database server by using the onspaces utility with the -Df "LOGGING=ON" option. This sbspace is a requirement for debugging SPL on ODS.
- If this is a fresh server instance, create a new database using the CREATE DATABASE statement. You will later use this database to create a Database connection in ODS to deploy and debug your SPL routines.
Routine Debugger Session Manager start-up (Optional)
In most cases, you can use the built-in session manager that ODS provides to debug your SPL routines. In some situations, however, (for example, if your server machine is behind a firewall), you might need to start a session manager on a TCP/IP port that has outbound access either on the server machine or on a different machine.
To start the session manager manually, follow these steps:
- To start the session manager manually, use the following command to export the CLASSPATH environment variable setting:
- Using Java 1.5.0 or above and ensuring it is in the PATH environment variable run the following command, specifying your port number that the session manager will use and a pathname for the session manager log file:
java com.ibm.db2.psmd.mgr.Daemon -port port_num -log sess_mgr_log_path
Steps in ODS to deploy and debug SPL Routines
To configure ODS to deploy and debug Informix SPL routines, , follow these steps:
- If you are not using the built-in session manager and have started a stand-alone session manager, use menu commands to configure that option in ODS (Window > Preferences > Run/Debug > Routine Debugger > DB2 screen) by choosing the "Use an already running Session manager" radio button, and providing the port number and the machine name.
- To configure ODS for debugging IDS SPL routines, you need to create a Database connection in the Data Source Explorer perspective in ODS. Refer to the Optim Development Studio documentation for details on how to create a Database connection.
- Right Click on the Database Connection > New Connection dialog box, choose Informix, and create a new database connection by choosing 'Informix 11.7 - IBM Data Server Driver for JDBC and SQLJ Default' from the Driver list. if that driver available. If 11.7 is not available, choose 'Informix 11.5 - IBM Data Server Driver for JDBC and SQLJ Default' from the Driver files: list..
- In the Edit Driver Definitions dialog box, open the Jar List tab and verify that it includes db2jcc4.jar. If it does not, replace db2jcc.jar with db2jcc4.jar in the Driver files: list.
- Refer to the Optim Development Studio documentation for details on how to Create, Deploy, and Debug SPL routines.
Now you are ready to create, deploy and debug IDS SPL routines in ODS.