Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot monitor JDBC Pool activities

I'm facing with a frustrating problem with jdbc

org.apache.tomcat.jdbc.pool.PoolExhaustedException: [...] Timeout: Pool empty. Unable to fetch a connection in 30 seconds, none available[size:4; busy:4; idle:0; lastwait:30000]

I found several solutions here about how to fix it but this is not the point.

I'd like to see from the logs WHO is creating these connections and not releasing.

Do you know some spring boot configuration or logback setup to show the event where a jdbc connection is taken from or returned to the pool?

Thanks

like image 644
Mirko Avatar asked Oct 19 '25 10:10

Mirko


1 Answers

If following Paul's recommendation doesn't help, my next step would be to add:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

Then use the /trace and /metrics endpoints to figure out whats happening.

like image 154
DaShaun Avatar answered Oct 22 '25 00:10

DaShaun



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!