Vert.x 4.0.3 Sql Client API using MariaDB Java Client 2.7.2

199 views
Skip to first unread message

Tobias Riemenschneider

unread,
Apr 8, 2021, 2:37:30 PM4/8/21
to vert.x
Hi,
we are currently struggling with exceptions thrown when executing prepared queries against MySQL using Vert.x 4.0.3 Sql Client API together with MariaDB Java Client 2.7.2.
We want to switch our code from the legacy JDBC Client API to the new Sql Client API and we are using this API for connecting to different DBs. This works for SQL Server using Microsoft JDBC Driver for SQL Server, MySQL using MySQL Connetor/J and embedded HSQLDB. Because of the GPL license we cannot use MySQL Connector/J, therefore we are using MariaDB Java Client for connecting  to MySQL.
Everything was fine with the legacy JDBC Client API but when we changed the code to Sql Client API (all other dependencies stayed at the same version) we started seeing exceptions like this:
java.lang.ArrayIndexOutOfBoundsException: 37
at org.mariadb.jdbc.internal.com.read.Buffer.skipLengthEncodedBytes(Buffer.java:228) ~[mariadb-java-client-2.7.2.jar:?]
at org.mariadb.jdbc.internal.com.read.resultset.ColumnDefinition.getString(ColumnDefinition.java:225) ~[mariadb-java-client-2.7.2.jar:?]
at org.mariadb.jdbc.internal.com.read.resultset.ColumnDefinition.getName(ColumnDefinition.java:243) ~[mariadb-java-client-2.7.2.jar:?]
at org.mariadb.jdbc.MariaDbResultSetMetaData.getColumnLabel(MariaDbResultSetMetaData.java:154) ~[mariadb-java-client-2.7.2.jar:?]
at io.vertx.jdbcclient.impl.actions.JDBCQueryAction.decodeReturnedKeys(JDBCQueryAction.java:188) ~[vertx-jdbc-client-4.0.3.jar:4.0.3]
at io.vertx.jdbcclient.impl.actions.JDBCQueryAction.decode(JDBCQueryAction.java:59) ~[vertx-jdbc-client-4.0.3.jar:4.0.3]
at io.vertx.jdbcclient.impl.actions.JDBCPreparedQuery.execute(JDBCPreparedQuery.java:69) ~[vertx-jdbc-client-4.0.3.jar:4.0.3]
at io.vertx.jdbcclient.impl.actions.JDBCPreparedQuery.execute(JDBCPreparedQuery.java:39) ~[vertx-jdbc-client-4.0.3.jar:4.0.3]
at io.vertx.ext.jdbc.impl.JDBCConnectionImpl.lambda$schedule$3(JDBCConnectionImpl.java:217) ~[vertx-jdbc-client-4.0.3.jar:4.0.3]
at io.vertx.core.impl.ContextImpl.lambda$null$0(ContextImpl.java:179) ~[vertx-core-4.0.3.jar:4.0.3]
at io.vertx.core.impl.AbstractContext.dispatch(AbstractContext.java:96) ~[vertx-core-4.0.3.jar:4.0.3]
at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:177) ~[vertx-core-4.0.3.jar:4.0.3]
at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76) ~[vertx-core-4.0.3.jar:4.0.3]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_282]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_282]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.60.jar:4.1.60.Final]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282]
Unfortunately these errors do not occur deterministic, therefore we were not yet able to build a small reproducer. 
Has anyone seen similar issues?
BR Toby

Tobias Riemenschneider

unread,
Apr 21, 2021, 3:06:16 AM4/21/21
to vert.x
Since this issue occurs in the processing of automatically generated keys I did a quick check if disabling the automatic key generation works around the problem. This check was successful, i.e., the issue does only occur when Vert.x 4.0.3 Sql Client API creates a prepared query using the Statement.RETURN_GENERATED_KEYS option and processes the generated keys afterwards. 
Unfortunately the automatic key generation cannot be disabled by configuration in Vert.x 4.0.3 so I had to modify some Vert.x code for performing this check.
Fortunately I found the conversation vertx-jdbc-client 4.0.2 - setAutoGeneratedKeys (google.com) which contains the information that the configuration of automatic key generation will be available in Vert.x 4.1.0.
Since I have to decide if we can wait for Vert.x 4.1.0 to become available or if we have to create a modified vertx-jdbc-client jar containing the code changes for our next release I would like to ask if there is any release date planned for Vert.x 4.1.0.
BR Toby

Tobias Riemenschneider

unread,
Apr 21, 2021, 10:10:10 AM4/21/21
to vert.x
I was finally able to track that issue down to an issue in MariaDB Connector/J (see https://jira.mariadb.org/browse/CONJ-873). The only remaining question is if there is already a release date for Vert.x 4.1.0 which would give us a workaround (disabling automatic key generation) for the issue in MariaDB Connector/J.

Julien Viet

unread,
Apr 23, 2021, 3:59:18 AM4/23/21
to vert.x
thanks for letting us know.

Julien
> --
> You received this message because you are subscribed to the Google Groups "vert.x" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/f31cece4-3897-4027-8aec-831c5783736en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages