Estoy ejecutando una aplicación Java con MySQL como servidor DB. DB es un RDS de AWS. El conector MySQL está publicado bajo GNU/GPL, por lo que debe sustituirse por algo más indulgente. El cliente Maria DB afirmó ser compatible. Pero desde que se está utilizando el cliente MariaDB, estamos viendo el siguiente problema intermitente durante las actividades intensivas de 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) He intentado aumentar time_wait y max_allowed_packet al máximo permitido, pero el problema persiste.
Versiones: - MySQL - 5.7.26 Conector MariaDB - 2.6.2
Acabo de encontrar esto, encontré una respuesta. Por mi parte, esto era para una base de datos MySQL Aurora 1 (equivalente a 5.6).
Según Diego Dupin en https://jira.mariadb.org/browse/CONJ-824 :
only good solution is to use option `usePipelineAuth=false&useBatchMultiSend=false`Entonces, la cadena de conexión de su base de datos podría tener este aspecto: jdbc:mysql://127.0.0.1:3307/mydbname?usePipelineAuth=false&useBatchMultiSend=false
Más detalles:
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.