"SQLException: JZ0R0: ResultSet has already been closed." from Sybase when share-prepared-statements is true in JBoss EAP

Solution Unverified - Updated -


  • A datasource pool using Sybase has <share-prepared-statements>true</share-prepared-statement>
  • A prepared statement is used to execute a query but the ResultSet is not fully traversed nor closed
  • The same prepared statement is used to execute a second query and the second result set is closed
  • When attempting to complete processing of the first result set, the exception below is raised

    java.sql.SQLException: JZ0R0: ResultSet has already been closed.
           at com.sybase.jdbc4.jdbc.ErrorMessage.raiseError(ErrorMessage.java:765)
           at com.sybase.jdbc4.jdbc.SybResultSet.checkResultSet(SybResultSet.java:3475)
           at com.sybase.jdbc4.jdbc.SybResultSet.next(SybResultSet.java:182)


  • Red Hat JBoss Enterprise Application Platform (EAP) 7
  • Sybase

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In