How to fixed Failed to obtain JDBC connection ; nested exception in a java.sql.SQLTransientConnectionException:HikariPool-1?

Viewed 1679

I am getting below error when number of user hitting the application will increase .

Restart will help to solve the issue for some time and again facing same issue when more user trying to access the application.

How Can I fixed this or How can I automatically restart when app get this issue?

org.springframework.jdbc.cannotgetjdbcconnectionexception: DatasourceHealthIndicator Failed to obtain JDBC connection ; nested exception in a java.sql.SQLTransientConnectionException: HikariPool-1 DatasourceHealthIndicator doHealthCheck()

Application properties file contain below

spring.datasource.hikari.max-pool-size = 10 spring.datasource.hikari.minimum-idle = 5

2 Answers

Bellow configuration worked for me . Thanks everyone for your help.

spring.datasource.hikari.connection-timeout = 600000

spring.datasource.hikari.maximum-pool-size = 15

spring.datasource.hikari.max-lifetime=1800000

In my case the solution was to upgrade the number of maximum-pool-size :D

Related