Question:
019-12-03 17:40:42.314 WARN 15940 — [nio-9008-exec-5] com.zaxxer.hikari.pool.PoolBase : HikariPool-1 – Failed to validate connection com.mysql.jdbc. JDBC4Connection@5eb7b0fb (No operations allowed after connection closed.)
java.lang.reflect.UndeclaredThrowableException
If there is no database operation after 15 minutes silence, the above error will be reported
Failed to validate connection com.mysql.cj.jdbc.ConnectionImpl
Analysis is the problem of connection management in Hikari connection pool
Solution
Add the following solution.
hikari:
minimum-idle: 3
maximum-pool-size: 10
max-lifetime: 30000 #Cannot be less than 30 seconds, otherwise default back to 1800 seconds
connection-test-query: SELECT 1
The last bug was updated. Sometimes the database connection configuration was correct, but it was found that the database could not be connected. The console connected to the default database. Later, it was found that the application.yml package was not generated under my target. Let’s record here. If the small partner has this problem, go to the Maven warehouse to clean it first, and then install it. The problem is solved.
Similar Posts:
- Mysql Cannot get a connection, pool error Timeout waiting for idle object
- [Solved] Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
- [Solved] Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- Logstash output jdbc Error: java.lang.IllegalAccessError: tried to access class com.mysql.jdbc.EscapeProcessor from class com.mysql.jdbc.ConnectionImpl
- [Solved] Springboot Project Connect MYSQL Error: Establishing SSL connection without server’s identity verification is not recommended.
- WARN: Establishing SSL connection without server’s identity verification is not recommended.
- How to Solve Navicat Remote Connection to MySQL is Stuck
- SSM Project Error: java.sql.SQLException: Access denied for user ‘????…§’@’localhost’ (…
- For the problem of establishing SSL connection in mysql, set usessl = false to explicitly disable SSL, or set usessl = true
- [Solved] Failed to bind properties under ” to com.zaxxer.hikari.Hikari DataSource Spring Boot