You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the cursors or stream an infinite loop is produced, stream.exceptionHandler or stream.endHandler will never be called. hasMore always indicates true.
Do you have a reproducer?
package org.example;
import io.vertx.core.Future;
import io.vertx.core.Vertx;
import io.vertx.core.json.JsonObject;
import io.vertx.jdbcclient.JDBCPool;
public class Example {
public static void main(String[] args) {
final Vertx vertx = Vertx.vertx();
final JsonObject config = new JsonObject()
.put("provider_class", "io.vertx.ext.jdbc.spi.impl.HikariCPDataSourceProvider")
.put("jdbcUrl", "jdbc:sqlserver://****:1433;databaseName=****;")
.put("driverClassName", "com.microsoft.sqlserver.jdbc.SQLServerDriver")
.put("username", "****")
.put("password", "****")
.put("max_pool_size", 1)
.put("initial_pool_size", 1)
.put("min_pool_size", 1)
.put("max_statements", 0)
.put("max_statements_per_connection", 0)
.put("max_idle_time", 0);
final JDBCPool pool = JDBCPool.pool(vertx, config);
pool.withTransaction(tx ->
tx.prepare("SELECT 1")
.map(pS -> pS.createStream(200))
.flatMap(stream -> Future
.future(promise -> {
stream.exceptionHandler(err -> {
System.out.println("Error: " + err.getMessage());
promise.fail(err);
});
stream.endHandler(v -> {
System.out.println("End of stream");
promise.complete();
});
stream.handler(row -> {
System.out.println(row.toJson().encode());
});
})
)
)
.onFailure(Throwable::printStackTrace);
}
}
Steps to reproduce
Add valid credentials
Create a basic POM with mssql driver and vertx-jdbc-client dependencies
Run
Extra
MacOS 11.1
AdoptOpenJDK (build 15.0.1+9)
I have used stable versions of the MSSQL driver, and the latest one (9.1.1.jre15-preview) with the same results.
I have used c3p0, Hikari and Agroal, also the same result.
With Vert.x 4.0.0 it returns 'The statement must be executed before any results can be obtained'.
I can avoid the infinite loop with one of these changes, but I understand that it could have repercussions:
ConnectionImpl.java: Line 126 -> change true to false
Version
4.0.1-SNAPSHOT
Context
When using the cursors or stream an infinite loop is produced, stream.exceptionHandler or stream.endHandler will never be called. hasMore always indicates true.
Do you have a reproducer?
Steps to reproduce
Extra
ConnectionImpl.java: Line 126 -> change true to false
Or change CursorImpl.java: Line 66 -> ignore isSuspended value and always return false
The text was updated successfully, but these errors were encountered: