I'm using queryStreamWithParams method to get stream of records from a table.
connection -> connection.queryStreamWithParams(query, params, streamAR -> {
if (streamAR.failed()) {
closeConnectionL(connection);
errorHandler.handle(streamAR.cause());
return;
}
SQLRowStream rowStream = streamAR.result();
rowStream.endHandler(streamEnd -> {
closeConnection(connection);
if (endHandler != null) {
endHandler.handle(null);
}
}).exceptionHandler(ex -> {
closeConnection(connection);
errorHandler.handle(ex);
});
Here's the stack trace:
java.sql.SQLException: Operation not allowed after ResultSet closed
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964) ~[mysql-connector-java-5.1.44.jar:5.1.44]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:897) ~[mysql-connector-java-5.1.44.jar:5.1.44]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:886) ~[mysql-connector-java-5.1.44.jar:5.1.44]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:860) ~[mysql-connector-java-5.1.44.jar:5.1.44]
at com.mysql.jdbc.ResultSetImpl.checkClosed(ResultSetImpl.java:743) ~[mysql-connector-java-5.1.44.jar:5.1.44]
at com.mysql.jdbc.ResultSetImpl.next(ResultSetImpl.java:6285) ~[mysql-connector-java-5.1.44.jar:5.1.44]
at io.vertx.ext.jdbc.impl.actions.JDBCSQLRowStream.readRows(JDBCSQLRowStream.java:207) ~[vertx-jdbc-client-3.5.4.1.jar:3.5.4.1]
at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:273) ~[vertx-core-3.5.4.jar:3.5.4]
at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76) ~[vertx-core-3.5.4.jar:3.5.4]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.32.Final.jar:4.1.32.Final]
at java.lang.Thread.run(Thread.java:834) [?:?]
I'm not able to figure pout what could the reason behind this exception. Please help.