Hi,
I tried to use mysql-connector-j to connect to Manticore Search in Java.
It works well when only use Java DriverManager.getConnection() to make the connection. But failed when use a connection pool like HikariCP in Spring Boot. It seems that the pool requests the server for the server’s version, transaction isolation level etc., but Manticore Search seems to response with “”.
I have followed the doc and set up the “mysql_version_string”.
The following is some error logs.
mysql-connector-j v8.0.22
Caused by: java.sql.SQLException: Could not map transaction isolation '<empty>' to a valid JDBC level.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:130)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:98)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:90)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:64)
at com.mysql.cj.jdbc.ConnectionImpl.getTransactionIsolation(ConnectionImpl.java:1193)
at com.zaxxer.hikari.pool.PoolBase.checkDefaultIsolation(PoolBase.java:480)
at com.zaxxer.hikari.pool.PoolBase.checkDriverSupport(PoolBase.java:443)
at com.zaxxer.hikari.pool.PoolBase.setupConnection(PoolBase.java:411)
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364)
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201)
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:470)
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561)
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:100)
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:160)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:118)
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:81)
... 27 common frames omitted
mysql-connectory-j v6.0.6
Caused by: java.lang.NumberFormatException: For input string: "<empty>"
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
at java.base/java.lang.Integer.parseInt(Integer.java:661)
at java.base/java.lang.Integer.parseInt(Integer.java:777)
at com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1360)
at com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1349)
at com.zaxxer.hikari.pool.PoolBase.setupConnection(PoolBase.java:403)
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364)
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201)
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:470)
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561)
... 33 common frames omitted
My questions are:
1, Can Manticore Search works with a connection pool manager like HikariCP, or I made some mistake?
2. What is the recommended way to connect Manticore Search in Java?
Thanks for your help very much!
Guofeng