Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/351.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 将mariaDB客户端与MySQL数据库集成的问题_Java_Mysql_Mariadb - Fatal编程技术网

Java 将mariaDB客户端与MySQL数据库集成的问题

Java 将mariaDB客户端与MySQL数据库集成的问题,java,mysql,mariadb,Java,Mysql,Mariadb,我正在运行一个java应用程序,使用MySQL作为DB服务器。DB是一个AWS RDS。MySQL连接器是在GNU/GPL下发布的,因此必须用更宽松的方式来替代它。Maria DB客户端声称兼容。但自从使用MariaDB客户端以来,我们在DB密集型活动期间看到以下间歇性问题: Excption:- SEVERE: Servlet.service() for servlet [dispatcher] in context with path [/Projectname] threw excepti

我正在运行一个java应用程序,使用MySQL作为DB服务器。DB是一个AWS RDS。MySQL连接器是在GNU/GPL下发布的,因此必须用更宽松的方式来替代它。Maria DB客户端声称兼容。但自从使用MariaDB客户端以来,我们在DB密集型活动期间看到以下间歇性问题:

Excption:-
SEVERE: Servlet.service() for servlet [dispatcher] in context with path [/Projectname] threw exception [Request processing failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection] with root cause
java.sql.SQLNonTransientConnectionException: (conn=1530488) Connection is closed
    at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.createException(ExceptionFactory.java:73)
    at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.create(ExceptionFactory.java:187)
    at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.cmdPrologue(AbstractQueryProtocol.java:1940)

Caused by: org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection
    at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:48)
    at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)

Caused by: java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=XXXXXXXXXX)(port=3306)(type=master) : (conn=1530487) could not load system variables
    at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.createException(ExceptionFactory.java:73)
    at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.create(ExceptionFactory.java:192)
    at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1372)
我已尝试将
等待时间
允许的最大数据包
增加到允许的最大值,但问题仍然存在

版本:- MySQL-5.7.26
MariaDB connector-2.6.2刚刚遇到了这个问题,找到了答案。在我这方面,这是一个Aurora 1 MySQL数据库(相当于5.6)

根据Diego Dupin在:

因此,您的DB连接字符串可能如下所示: jdbc:mysql://127.0.0.1:3307/mydbname?usePipelineAuth=false&useBatchMultiSend=false

更多详情:

Aurora proxy has a known race condition issue that results in skipping other 
queries in proxy buffer. connection might be in hang waiting for query response. 
During authentication, socket has a timeout, that will result throwing the error 
you describe.

So if `usePipelineAuth` or `useBatchMultiSend` is enable, it might work ... or not. 
All pipeline options (`usePipelineAuth` and `useBatchMultiSend`) must be disabled when using aurora. 
Problem has been reported to aurora a few times without correction.
Aurora proxy has a known race condition issue that results in skipping other 
queries in proxy buffer. connection might be in hang waiting for query response. 
During authentication, socket has a timeout, that will result throwing the error 
you describe.

So if `usePipelineAuth` or `useBatchMultiSend` is enable, it might work ... or not. 
All pipeline options (`usePipelineAuth` and `useBatchMultiSend`) must be disabled when using aurora. 
Problem has been reported to aurora a few times without correction.