How to troubleshoot JDBC datasources
Applies to
HCL Digital Experience v8.5 and higher
Introduction
Troubleshooting Java Database Connectivity (JDBC) database-related problems can be complicated and might lead to performance issues when enabling detailed JDBC driver traces. It is suggested to start the analysis by troubleshooting the SQL queries. This article describes how to troubleshoot or debug JDBC datasources in HCL Digital Experience (DX).
Instructions
To troubleshoot JDBC datasources, you can troubleshoot or debug SQL queries.
Troubleshooting SQL queries
To troubleshoot SQL queries, refer to the following steps:
-
Enable the trace string
com.ibm.wps.datastore.impl.*=allby following the instructions in Trace logging. -
Review the traces and check for query execution times by examining timestamps in the logs, correlating by thread ID.
Check for trace-entries that contain
executeQuery SubmittingandCall stmt.executeQuery() finished.If you do not find trace-entries, try increasing the trace-string to:
com.ibm.ws.rsadapter.jdbc.*=all:com.ibm.websphere.query.*=all
For more information on troubleshooting the problem, refer to the following technotes:
- Collecting Data: Tracing with the IBM Data Server Driver for JDBC and SQLJ
- Collecting JDBC Driver Tracing in WebSphere Application Server
Debugging SQL queries and their result sets
To debug SQL queries, refer to the following steps:
Note
JDBC driver traces might lead to performance problems. If you want to debug SQL queries that will be sent from HCL DX to the database along with their result sets, the following steps might help you obtain more details in the trace.log file of HCL DX.
- Start HCL DX and log in to the WebSphere Integrated Solutions Console as administrator.
- Navigate to Resources > JDBC > Data sources > yourDatasourceName > Custom properties.
-
For DB2 datasources, change the value of the
traceLevelcustom property to16384,2, or some other value based on the suggested list mentioned in Provider-specific configuration.Note
Depending on the JDBC provider (for example, Microsoft or Oracle), the custom property for increasing the trace level might be different. Contact the JDBC driver vendor to determine the correct procedure to enable JDBC driver traces.
-
Click Apply.
- Click Save at the top of the console messages.
- Enable the trace string
WAS.database=allby following the instructions in Trace logging. - Restart the HCL DX server.
- Reproduce the problem. For example, execute the desired actions to generate the query to the database.
- Review the SQL queries and result sets in the trace file. The default location is at
<wp_profile_root>/logs/WebSphere_Portal/trace.log.