Problems accessing a Cloudscape database
What kind of problem are you having accessing your Cloudscape database?
- Cloudscape has discovered a security exposure for version 5.1 of Cloudscape Network Server
- Unexpected IO exception wrapped in SQL exception, accessing Cloudscape database.
- The "Select for update" operation on one row causes table to become locked, triggering a deadlock condition.
- "ERROR XSDB6: Another instance of Cloudscape might have already booted the database databaseName." error starting appserver.
- Error "The version of the IBM Universal JDBC driver in use is not licensed for connectivity to Cloudscape databases"
- Running an application causes a runtime exception which produces an unreadable message.
- Unexpected SQL exception after initially configuring Cloudscape Network Server for use with WebSphere Application Server, version 5.0.2 or later.
- The administrative console displays DB2 settings instead of Cloudscape settings when you create a new Cloudscape JDBC Provider Network Server using the universal JDBC driver provider.
Tip: Cloudscape errorCodes (2000, 3000, 4000) indicate levels of severity, not specific error conditions. In diagnosing Cloudscape problems, pay attention to the given sqlState value.
Cloudscape has discovered a security exposure for version 5.1 of Cloudscape Network Server
Cloudscape has uncovered a serious security problem on the Cloudscape 5.1 Network Server framework. WebSphere users who run against Cloudscape NetworkServer are exposed by this problem. For more details on this problem and the exposures, follow this URL to the Cloudscape Web site: http://www.ibm.com/support/docview.wss?uid=swg21161241&rs=260 .
WebSphere customers should download fix PQ86524, which will upgrade the Cloudscape version in WebSphere to the level that rectifies the problem.
Please Note the following changes with respect to the new Cloudscape version:
- Cloudscape Network Server will, by default, only listen on the localhost; thus, clients cannot access the Cloudscape Network Server from another host. To enable connections from other hosts, uncomment the db2j.drda.host property located in the ${Cloudscape_Home}/db2j.properties file. This step will make the value of 0.0.0.0 take effect.
- Cloudscape Network Server administrative commands (e.g. sysinfo, stopNetworkServer, ..) can only be executed on the host on which the server was started, regardless of the db2j.drda.host property setting.
- To avoid the security exposure of Cloudscape Network Server when it is configured to accept connections from remote hosts, enable the Java2 security in WebSphere Application Server.
Unexpected IOException wrapped in SQLException, accessing Cloudscape database
This problem can occur because Cloudscape databases use a large number of files. Some operating systems, such as the Solaris Operating Environment, limit the number of files an application can open at one time. If the default is a low number, such as 64, you can get this exception.
If your operating system lets you configure the number of file descriptors, you can correct the problem by setting the number to a high value, such as 1024.
The "select for update" operation causes table lock and deadlock when accessing Cloudscape
If a select for update operation on one row locks the entire table, which creates a deadlock condition, there might be undefined indexes on that table. The lack of an index on the columns you use in the where clause can cause Cloudscape to create a table lock rather than a row level lock.
To resolve this problem, create an index on the affected table.
ERROR XSDB6: Another instance of Cloudscape may have already booted the database "database"
This problem occurs because Cloudscape embedded framework only allows one Java virtual machine (JVM) to access the database instance at a time.
To resolve this problem:
Error "The version of the IBM Universal JDBC driver in use is not licensed for connectivity to Cloudscape databases"
- Verify that you do not have other JDBC client programs, such as ij or cview running on that database instance, when WebSphere Application Server is running.
- Verify that you do not use the same instance of the database for more than one data source or use the networkServer framework, which doesn't have this limitation.
- If there are no connections to Cloudscape, delete the db.lck lock file. This file can be found in the directory where the Cloudscape database is mounted, under the schema directory. For example, if the database is mounted at /myCloudscapeDB, issue the command: rm /myCloudscapeDB/schemaName/db.lck
Error "The version of the IBM Universal JDBC driver in use is not licensed for connectivity to Cloudscape databases"
At the client runtime, an error similar to the following occurs:
The version of the IBM Universal JDBC driver in use is not licensed for connectivity to Cloudscape databases. To connect to this DB2 server, please obtain a licensed copy of the IBM DB2 Universal Driver for JDBC and SQLJ. An appropriate license file db2jcc_license_*.jar for this target platform must be installed to the application classpath. Connectivity to Cloudscape databases is enabled by any of the following license files: { db2jcc_license_c.jar, b2jcc_license_cu.jar, db2jcc_license_cisuz.jar }The problem occurs because an incorrect JDBC driver jar file name is specified in the class path for JDBC provider. For example, the jar file name may have an extra '_', as follows:
${UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license__cu.jar
To resolve the problem:
- Correct the UNIVERSAL_JDBC_DRIVER_PATH jar file name in the JACL script
- Restart the cluster.
- Rerun the client.
Running an application causes a runtime exception which produces an unreadable message.
At client runtime, you may receive a message similar to the following: Caused by: com.ibm.db2.jcc.a.SqlException: DB2 SQL error: SQLCODE: -1, SQLSTATE: 42X05, SQLERRMC: ANNUITYHOLDER20^T42X05
The problem occurs because the property retrieveMessagesfromServerOnGetMessage, which is required by WebSphere Application Server, has not been set.
To resolve the problem, on the admininstrative console
The SystemOut.log will now generate readable messages so that you can resolve the underlying problem.
- Click Resources -> JDBC Providers
- Click on a Cloudscape provider
- Scroll down and click on Data Sources
- Select your data source (or add a new one)
- Scroll down and select Custom Properties
- If the property retrieveMessagesFromServerOnGetMessage already exists, set its value to true. If the property does not exist, select Newand add the property retrieveMessagesFromServerOnGetMessage with a value true
- Rerun the client
Unexpected SQL exception after initially configuring Cloudscape Network Server for use with WebSphere Application Server, version 5.0.2 or later
Problem When running WebSphere Application Server, version 5.0.2 or later, with Cloudscape using the Network Server framework, you receive the following exception:
com.ibm..db2.jcc.b.SQLException: Unexpected throwable caught java.lang.UnsatisfiedLinkError: DBConnectRecommended response Verify that you have supplied a value for the driverType data source custom property, and that the value is not 2. For more information about configuring Cloudscape Network Server using the Universal JDBC driver, refer to the Cloudscape section of the topic Vendor-specific data sources minimum required settings. The administrative console displays DB2 settings instead of Cloudscape settings when you create a new Cloudscape JDBC Provider Network Server using the universal JDBC driver provider.
Problem When creating a new Cloudscape JDBC Provider Network Server using the universal JDBC driver provider through the administrative console in Websphere Application Server, version 5.0.2 or later, be aware that the administrative console fills in the DB2 universal data sources settings by default instead of the Cloudscape Network Server settings. These erroneous settings include: The provided implementation class, however, is correct. The implementation class for the DB2 universal driver provider happens to be the same as that required for the Cloudscape JDBC Provider Network Server.
- the DataStoreHelper class
- the data source custom properties
Recommended response If you want to create the Cloudscape JDBC Provider Network Server using the universal JDBC driver provider, modify the entries in the administrative console as follows:
- Change the DataStoreHelper class to:
com.ibm.websphere.rsadapter.CloudscapeNetworkServerDataStoreHelper
- Supply the required custom properties with these values:
You have the option of changing the portNumber property, which is the port number on which Network Server listens for connection requests. The default is port 1527. You must either supply another number, or accept the default.
- driverType: 4 (Type 4 driver is the only valid value for Network Server)
- serverName: your server TCP/IP address or name
- databaseName: your database name (For example, c:\mydb)
- retrieveMessagesFromServerOnGetMessage: true (This is required by WebSphere Application Server, not the database. Do not use the database default setting, which is false.)
The following data source custom properties are optional:
- logWriter
- traceLevel
- traceFile
- traceFileAppend
- deferPrepares (This property works as documented, with the exception of the prepare on EXECUTE STATEMENT, which can never be deferred for Cloudscape.)
- resultSetHoldability (Defaults to CLOSE_CURSORS_AT_COMMIT for Cloudscape. This is the only valid value for Network Server. Use the JDBC 3.0 API for setting holdability.)
- securityMechanism (Network Server supports these security mechanisms, the first being the default:
com.ibm.db2.jcc.DB2BaseDataSource.CLEAR_TEXT_PASSWORD_SECURITY com.ibm.db2.jcc.DB2BaseDataSource.ENCRYPTED_PASSWORD_SECURITY
Troubleshooting by task: What are you trying to do?
Troubleshooting by component: What is not working?
Example: Accessing data using IBM extended APIs to share connections between container-managed and bean-managed persistence beans
Cannot access a data source
Problems accessing an Oracle data source
Problems accessing a DB2 database
Problems accessing a SQL server data source
Problems accessing a Sybase data source
Data access application programming interface support