Diagnosing Database connectivity problems for DB2 data sources
 Technote (troubleshooting)
 
Problem(Abstract)
Diagnostic information for problems with the WebSphere® Application Server DB Connectivity (DB2®) component.
 
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
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.


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:

      DB2 Universal JDBC Driver Provider
      DB2 Universal JDBC Driver Provider (XA)
      DB2 Legacy CLI -based Type 2 JDBC Driver
      DB2 Legacy CLI -based Type 2 JDBC Driver (XA)
      DB2 UDB for ISeries (Native - V5R2 and later)
      DB2 UDB for ISeries (Native XA - V5R2 and later)
      DB2 UDB for ISeries (Native - V5R1 and earlier)
      DB2 UDB for ISeries (Native XA - V5R1 and earlier)
      DB2 UDB for ISeries (Toolbox)
      DB2 UDB for ISeries (Toolbox XA)

    • The data source name an indication whether this is a WAS V4 data source or a WebSphere Application Server V5.0 or V5.1 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
    • Note: WebSphere Application Server does not support 64-bit client drivers, but it does support connecting to a 64-bit database 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.
  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.
    • WebSphere Application Server V5.0:Enable the following trace:
      com.ibm.ejs.jts.*=all=enabled:EJBContainer=all=enabled:PMGR=all=enabled:WAS.j2c=all=enabled:RRA=all=enabled:WAS.database=all=enabled
    • WebSphere Application Server V5.1:Enable the following trace:
      Transaction=all=enabled:EJBContainer=all=enabled:PMGR=all=enabled:WAS.j2c=all=enabled:RRA=all=enabled:WAS.database=all=enabled
  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.
 
Related information
Submitting information to IBM Support
Steps to getting support
MustGather: Readme first
Troubleshooting guide
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > DB Connections/Connection Pooling
Operating system(s): Windows
Software version: 5.1
Software edition:
Reference #: 1223797
IBM Group: Software Group
Modified date: Nov 29, 2005