IBM Support

XA Connection Error: SQL OPEN for a held cursor was issued on a XA connection ERRORCODE=-4496, SQLSTATE=null

Troubleshooting


Problem

I received the following error message when setting up an XA connection using JDBC and Websphere: SQL OPEN for a held cursor was issued on a XA connection ERRORCODE=-4496, SQLSTATE=null

Symptom

SQL OPEN for a held cursor was issued on a XA connection ERRORCODE=-4496, SQLSTATE=null

Resolving The Problem

The JDBC driver doesn't allow a held cursor to be opened on the database server for an XA connection.


Solution:

1.) It is suggested that you set the following to true: downgradeHoldCursorsUnderXa. The documentation link below illustrates that the DB2XADataSource extends DB2BaseDataSource and thus this property should be available for use.

Common IBM Data Server Driver for JDBC and SQLJ properties for all supported database products

"The com.ibm.db2.jcc.DB2XADataSource class extends the com.ibm.db2.jcc.DB2BaseDataSource class, and implements the javax.sql.XADataSource, java.io.Serializable, and javax.naming.Referenceable interfaces. "

DB2XADataSource class

2.) Check the location of the db2jcc.jar is correct and that Websphere can see it.

3.) Check if the correct driver is being used by Websphere. The default location of the JCC driver is .../sqllib/java/db2jcc.jar. Websphere may use its own copy which can be found somewhere else on the system.

If you still see the error after trying the above suggestion then contact DB2 support team to report the problem.

Related Information

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Programming Interface - JDBC - Type 2","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.7;9.5;9.1;8.2","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21386486