"SQLException: JZ0R0: ResultSet has already been closed." from Sybase when share-prepared-statements is true in JBoss EAP
Issue
- A datasource pool using Sybase has
<share-prepared-statements>true</share-prepared-statement> - A prepared statement is used to execute a query but the
ResultSetis 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)
Environment
- 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.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
