Error conection database mysql log

In the apache log where the mouse is running always has this database connection error, I am using MySql, but the application is working fine, but these errors in the log bother me. Here are some of them:

  • Caused by: org.apache.ibatis.transaction.TransactionException: Error configuring AutoCommit.
  • Caused by: com.mysql.cj.jdbc.exceptions.CommunicationsException:
  • Caused by: java.net.SocketException: Broken pipe (Write failed)
  • Cause: org.apache.ibatis.transaction.TransactionException: Error configuring AutoCommit. Your driver may not support getAutoCommit() or setAutoCommit(). Requested setting: false. Cause: com.mysql.cj.jdbc.exceptions.CommunicationsException:

@MarceloCP, Are you using tomcat connection pool?

Configure these properties testOnBorrow , validationQuery and validationInterval.

DB_VALIDATE_ON_BORROW  = true
transaction-isolation = READ-COMMITTED

Refer these settings:

<Resource name="jdbc/ProcessEngine"
          auth="Container"
          type="javax.sql.DataSource"
          factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
          uniqueResourceName="process-engine"
          driverClassName="com.mysql.jdbc.Driver"
          url="jdbc:mysql://XXXX:3306/camunda?autoReconnect=true"
          username="XXXX"
          password="XXXX"
          maxActive="20"
          minIdle="10" 
		  testWhileIdle="true"
		  testOnBorrow="true"
		  testOnReturn="false"
		  validationQuery="SELECT 1"
		  validationInterval="30000"
		  timeBetweenEvictionRunsMillis="30000"
		  maxWait="10000"
		  removeAbandonedTimeout="60"
		  removeAbandoned="true"
		  logAbandoned="true"
		  minEvictableIdleTimeMillis="30000"
		  connectionTimeout="300000"
		  jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;
				org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer;
				org.apache.tomcat.jdbc.pool.interceptor.ResetAbandonedTimer" />

https://github.com/camunda/docker-camunda-bpm-platform/issues/125