en Peris
en Peris

Reputation: 1717

Unable to acquire JDBC Connection in SpringBoot app

I have a Microservices‑Based Application, each Microservice is a SpringBoot 2.0.3.RELEASE app., but after my 4rth Microservices launched I have this error:

    Unable to acquire JDBC Connection; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection
..
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Too many connections

I would like to know how to reduce the maximumPoolSize or if there is a way to know maximumPoolSize because I have't seen anything related when the app starts

Upvotes: 1

Views: 17731

Answers (1)

rieckpil
rieckpil

Reputation: 12051

You can set the maximum pool size of the JDBC connections in your application.properties file like:

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

Upvotes: 4

Related Questions