Description
public void test() throws Exception { String query = "SELECT a_string FROM " + tableName + " WHERE organization_id=? LIMIT 1"; Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); try(Connection conn = DriverManager.getConnection(getUrl(), props)) { PreparedStatement statement = conn.prepareStatement(query); statement.setString(1, tenantId); ResultSet rs = statement.executeQuery(); while (rs.next()) { } assertFalse(rs.next()); // exception happens here } }
java.sql.SQLException: ERROR 1101 (XCL01): ResultSet is closed. at org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:615) at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:217) at org.apache.phoenix.jdbc.PhoenixResultSet.checkOpen(PhoenixResultSet.java:288) at org.apache.phoenix.jdbc.PhoenixResultSet.next(PhoenixResultSet.java:847) at org.apache.phoenix.end2end.QueryIT.test(QueryIT.java:184) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Need to remove the unnecessary close inside the next method.
Attachments
Issue Links
- links to