{"record":{"id":"fa20c1677316621d","repo":"prestodb/presto","slug":"resultset-is-closed","errorCode":null,"errorMessage":"ResultSet is closed","messagePattern":"ResultSet is closed","errorType":"exception","errorClass":"SQLException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":1659,"sourceCode":"    }\n\n    @Override\n    public boolean isWrapperFor(Class<?> iface)\n            throws SQLException\n    {\n        return iface.isInstance(this);\n    }\n\n    void partialCancel()\n    {\n        client.cancelLeafStage();\n    }\n\n    private void checkOpen()\n            throws SQLException\n    {\n        if (isClosed()) {\n            throw new SQLException(\"ResultSet is closed\");\n        }\n    }\n\n    private void checkValidRow()\n            throws SQLException\n    {\n        if (row.get() == null) {\n            throw new SQLException(\"Not on a valid row\");\n        }\n    }\n\n    private Object column(int index)\n            throws SQLException\n    {\n        checkOpen();\n        checkValidRow();\n        if ((index <= 0) || (index > resultSetMetaData.getColumnCount())) {\n            throw new SQLException(\"Invalid column index: \" + index);","sourceCodeStart":1641,"sourceCodeEnd":1677,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L1641-L1677","documentation":"checkOpen is a sentinel guard used at the start of nearly every PrestoResultSet method: if isClosed() returns true (after close() or statement/connection closure) it throws this SQLException, preventing access to a result set whose backing query resources have been released.","triggerScenarios":"Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java:1659 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the result set is not closed before calling getters, or keep a reference until done reading rows","Check whether the owning Statement/Connection was closed prematurely (try-with-resources ordering)","Guard generic JDBC framework code with isClosed() checks or catch the SQLException"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}