IBM Support

Diagnosing Database connectivity problems for DB2 data sources

Troubleshooting


Problem

Diagnostic information for problems with the WebSphere® Application Server DB Connectivity (DB2®) component.

Symptom

The attempt to connect to a data source using WebSphere Application Server fails with one of the following error messages:
DSRA0040E: WebSphere internal error occurred.
DSRA8040I: Failed to connect to the DataSource.
DSRA8100E: Unable to get a XAConnection from the DataSource.

Cause

This document describes what data to collect to assist yourself or IBM® support in analyzing and resolving problems involving connectivity to a data source or getting a connection from a data source.

Resolving The Problem

If you have already contacted support, continue on to the DB Connectivity (DB2) MustGather information. Otherwise, click: MustGather: Read first for all WebSphere Application Server products.

DB Connectivity (DB2) specific MustGather information

  1. Provide the following information about the database client
    • The DB2 level that is used; provide the output from the db2level command. This should be done using the DB2 administrative id and db2 should be started.

      To get detail information about the database level and FixPak, we use the db2level command:

      >> db2level
      DB21085I  Instance "db2udb1" uses DB2 code release "SQL07025" with level identifier "03060105" and informational tokens "DB2 v7.1.0.20", "s020616" and "U484483".

    • The driver used to connect to the database (that is, what was selected from the drop down list on the JDBC Providers screen:

    • The data source name an indication whether this is a WAS V4 data source or a WebSphere Application Server V5.0 data source
    • The Classpath and Native library path for the JDBC Datasource.

  2. Provide the following information about the database server
    • The DB2 version used by the server by running db2level on the server.
    • The operating system of the server

  3. Provide the following information about the network configuration between WebSphere Application Server and the DB Server
    • an indication whether the DB server is remote (on a different physical server) than WebSphere Application Server
    • Is there a firewall between WebSphere Application Server and the database server?

  4. If the data source has just been configured or the configuration has just been changed, stop and restart WebSphere Application Server to see if this resolves the problem.

  5. Check the WebSphere Application Server logs for the server that the database is defined on for errors that may indicate that the database driver did not load. In particular, check the SystemErr.log.

    The java.lang.UnsatisfiedLinkError will look similar to this.
    [8/23/04 10:35:25:640 CDT] 61989412 SystemErr     R java.lang.UnsatisfiedLinkError: SQLBindChar
    [8/23/04 10:35:25:640 CDT] 61989412 SystemErr     R     at  COM.ibm.db2.jdbc.app.DB2PreparedStatement.execute2(DB2PreparedStatement.java(Compiled Code))
    [8/23/04 10:35:25:640 CDT] 61989412 SystemErr     R     at  COM.ibm.db2.jdbc.app.DB2PreparedStatement.executeQuery(DB2PreparedStatement.java(Compiled Code))                                                  
    This error indicates that a library or dll needed by DB2 could not be found. Some of the possible reasons for this are:
    • This could be due to the path information configuration being incorrect.
    • This could be a permissions problem accessing the library.
    • This could be caused by accessing a 32-bit JDBC library from a 64-bit jvm or it could be caused by accessing a 64-bit JDBC library from a 32-bit jvm.

  6. Test the connection using the Test Connection button. The Test Connection button will use either the Container-managed authentication or the Component-managed authentication.
    • If the TestConnection is successful, but the application is not successful, then this means that the application is not configured to use the correct authentication mechanism. If there is a J2CA0294W message logged prior to the application failing to connect to the database, then the application used Component-managed authentication, since this is the default. If the application is not specifying a userid and password programmatically, then the solution is either to use a resource reference to look up the resource in the application, that is a java:comp/env reference OR to configure a Component-managed authentication alias for the data source. Also, refer to the technote, J2CA0294W: Deprecated usage of direct JNDI lookup of resource.
    • If the TestConnection fails but the application is successful, then it is because the application is specifying a different userid/password within the application and Component-managed authentication is being used by the application.
    • If the test connection fails due to a problem with the userid and password, then make sure that a J2C authentication alias has been set for the data source. Refer to the WebSphere Application Server Information Center for information on how to configure the J2C authentication alias.
  7. Test connecting to the data source from a DB2 command line. If this is successful, then this means that the connectivity to the database server is ok.
  8. If by this point, the problem is not resolved, enable a WebSphere trace.
    • *=info:Transaction=all:EJBContainer=all:PMGR=all=enabled:WAS.j2c=all:RRA=all:WAS.database=all
  9. Run the Collector tool for WebSphere Application Server to gather the trace and logs files
  10. Run the db2support command to gather the DB2 log data; this will get the db2diag.log. This is the command that is recommended to run. Run this as the DB2 administrative user:

    db2support . -s

    See this link for more information on the db2support command.

  11. Gather the following
    • Collector tool output
    • Output from the db2level command
    • Output of db2support command
    • Responses to questions, above

  12. Follow instructions to send diagnostic information to IBM support.

For a listing of all technotes, downloads, and educational materials specific to the DB Connectivity (DB2) component, search the WebSphere Application Server support site.

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"DB Connections\/Connection Pooling","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF012","label":"IBM i"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"8.5.5;8.5;8.0;7.0","Edition":"Base;Express;Network Deployment","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSNVBF","label":"Runtimes for Java Technology"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Java SDK","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
15 June 2018

UID

swg21223797