What kind of problem are you having accessing your DB2 database?
SQL0567N "DB2ADMIN " is not a valid authorization ID. SQLSTATE=42602
SQL0805N Package package-name was not found
The db2ubind.lst and db2cli.lst files are in the bnd directory of your DB2 installation root. Run the commands from that directory.
SQL0805N Package "NULLID.SQLLC300" was not found. SQLSTATE=51002
To resolve this problem, rebind the DB2 packages by running the db2cli.lst script found in the bnd directory. For example: db2>@db2cli.lst.
SQL30082N Attempt to establish connection failed with security reason "17" ("UNSUPPORTED FUNCTION') SQLSTATE=08001
To resolve this problem, ensure that your client and server use the same security mechanism. For example, if this is an error on your data source, verify that you have assigned a user id and password or authentication alias.
SQLException, with ErrorCode -99,999 and SQLState 58004, with Java "StaleConnectionException: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0119E Unexpected system failure. SQLSTATE=58004", when using WAS40-type data source
2002-07-26-14.19.32.762905 Instance:db2inst1 Node:000 PID:9086(java) Appid:*LOCAL.db2inst1.020726191932 XA DTP Support sqlxa_open Probe:101 DIA4701E Database "POLICY2" could not be opened for distributed transaction processing. String Title: XA Interface SQLCA PID:9086 Node:000 SQLCODE = -1403
db2connect to dbname c:\SQLLIB\bnd>DB2 bind @db2ubind.lst blocking all grant public c:\SQLLIB\bnd>DB2 bind @db2cli.lst blocking all grant public
Error message java.lang.reflect.InvocationTargetException: com.ibm.ws.exception.WsException: DSRA0023E: The DataSource implementation class "COM.ibm.db2.jdbc.DB2XADataSource" could not be found. when trying to access a DB2 database
One possible reason for this exception is that a user is attempting to use a JDBC 2.0 DataSource, but DB2 is not JDBC 2.0-enabled. This situation frequently happens with new installations of DB2 because DB2 provides separate drivers for JDBC 1.X and 2.0, with the same physical file name. By default, the JDBC 1.X driver is on the class path.
CLI0119E System error. SQLSTATE=58004 - DSRA8100 : Unable to get a XAconnection or DSRA0011E: Exception: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0119E Unexpected system failure. SQLSTATE=5800
If you encounter this error while running DB2 on Red Hat Linux, the max queues system wide parameter is too low to support DB2 while it acquires the necessary resources to complete the transaction. When this problem exists, the exceptions J2CA0046E and DSRA0010E can precede the exception DSRA8100E.
To correct this problem, edit the /proc/sys/kernal/msgmni file to increase the value of the max queues system wide parameter to a value greater than 128.
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0911N The current transaction has been rolled back because of a deadlock or timeout. Reason code "2". SQLSTATE=40001
ERROR CODE: -911 COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0911N The current transaction has been rolled back because of a deadlock or timeout. Reason code "2". SQLSTATE=40001
For example, consider the scenario where transaction A deletes the row with column1=10 and transaction B does a scan where column1>8 and column1<12. With DB2_RR_TO_RS off, transaction B waits for transaction A to commit or rollback. If transaction A rolls back, the row with column1=10 is included in the result set of the transaction B query. With DB2_RR_TO_RS on, transaction B does not wait for transaction A to commit or rollback. Transaction B immediately receives query results that do not include the deleted row. Setting DB2_RR_TO_RS effectively changes locking behavior, thus avoiding deadlocks.
"COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource" could not be found for data source ([data-source-name])"
This error is denoted by message DSRA8040I: Failed to connect to the DataSource.
This error usually occurs when the class path of the DB2 JDBC driver is set correctly to ${DB2_JDBC_DRIVER_PATH}/db2java.zip but the environment variable DB2_JDBC_DRIVER_PATH is not set.
This error can also occur if you are using DB2 Version 7.1 or 7.2 and you have not yet run usejdbc2. This might be the problem if your path is correct but you still receive this error.
To correct this problem: Add the variable DB2_JDBC_DRIVER_PATH with value equal to the directory path containing the db2java.zip file.
java.sql.SQLException: Failure in loading T2 native library db2jcct2 DSRA0010E: SQL State = null, Error Code = -99,999
Lock contention exception occurs in database when data source implementation type is XA
Symptom | A lock contention exception occurs in a DB2 database that your application accesses through a data source of implementation type XA. |
Problem | Your application is trying to access database records that are locked by an XA transaction that is in ended (e) state, but cannot be prepared by the transaction manager. |
Description | An XA transaction to DB2 that ends, but cannot be prepared, is in
ended (e) state. Because it is not considered to be in doubt,
the transaction manager cannot recover this transaction. DB2 does not return
it in the list of in doubt transactions. DB2 also does not roll the transaction
back immediately; it waits until all connections to the database are released.
During this period of inaction, the transaction continues to hold locks on
the database. Due to certain policies of WebSphere Application Server workload management, your application server might not disconnect all connections from the database to allow rollback of the transaction. Therefore the ended transaction persists in locking the same database records. If your application attempts to access these locked records, a lock contention exception occurs in DB2. |
Recommended response | DB2 Version 8.2 is shipped with a sample application that connects to a defined DB2 server and uses the available DB2 APIs to obtain a list of these particular ended transactions. The application offers a configuration setting that enables you to designate an amount of time after which the application rolls these transactions back. Locate the sample application in the sqllib/samples/db2xamon.c directory of DB2 Version 8.2 and run it. |
"DSRA8050W: Unable to find the DataStoreHelper class specified" exception occurs when trying to use a DB2 Universal Datasource in a mixed release cell.
This error usually occurs when you are using WebSphere Application Server Version 6 in conjunction with a previous version and attempt to create a DB2 Universal Datasource on the previous version.
This can happen because the DB2 Universal Datasource was not available on Version 5 and previous versions, but the Version 6 administrative console allows you to build one.
To correct this problem: create the datasource on Version 6.
Receive "'SYSTEM' is not a valid authorization ID" message when trying to access DB2 on a Windows machine where WebSphere Application Server is also installed.
Symptom | For a WebSphere Application Server on Windows installation that uses
DB2 as the backend, you see the following exception in the JVM log:java.sql.SQLException: [IBM][CLI Driver] SQL0567N "SYSTEM" is not a valid authorization ID. SQLSTATE=42602 DSRA0010E: SQL State = 42602, Error Code = -567 at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException (Unknown Source) at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code (Unknown Source) at COM.ibm.db2.jdbc.app.DB2Connection.connect(Unknown Source) at COM.ibm.db2.jdbc.app.DB2Connection.<init>(Unknown Source) at COM.ibm.db2.jdbc.app.DB2ReusableConnection.<init>(Unknown Source) at COM.ibm.db2.jdbc.DB2PooledConnection.getConnection(Unknown Source) at com.ibm.ws.rsadapter.spi.WSRdbDataSource.getConnection (WSRdbDataSource.java:1035) at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl. createManagedConnection(WSManagedConnectionFactoryImpl.java:937) at com.ibm.ejs.j2c.poolmanager.FreePool. createManagedConnectionWithMCWrapper(FreePool.java:1502) |
Problem | This exception occurs for configurations in which WebSphere Application Server is a client to the DB2 server. The underlying problem is an authorization conflict between WebSphere Application Server on Windows and DB2 that arises when an application attempts to connect to DB2 without providing a user ID and a password. |
Description | When a DB2 client and the DB2 database run on the same machine, DB2 allows the client to connect without a user ID and password. The connection is made under the credentials of the user that owns the client process: in this case, the application server JVM. However, if WebSphere Application Server runs as a Windows service, and the "Log on as" option is set to "Local System Account", the application server JVM is categorized as a subcomponent of a special Windows user called SYSTEM. This user is not allowed to connect to DB2, resulting in the previously shown exception. |
Recommended response | You have two options:
|
Related tasks
Troubleshooting by task
Troubleshooting by component
Example: Accessing data using IBM extended APIs to share connections
between container-managed and bean-managed persistence beans
Related reference
Cannot access a data source
Problems accessing an Oracle data source
Problems accessing a SQL server data source
Problems accessing a Cloudscape database
Problems accessing a Sybase data source
Extensions to data access APIs