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

Technote (troubleshooting)


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

Resolving the problem

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


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

JDBC Error Codes

Rate this page:

(0 users)Average rating

Add comments

Document information

More support for:

DB2 for Linux, UNIX and Windows

Software version:

8.2, 9.1, 9.5, 9.7

Operating system(s):

AIX, HP-UX, Linux, Solaris, Windows

Reference #:


Modified date:


Translate my page

Machine Translation

Content navigation