HikariCP - connection is not available

前端 未结 2 395
清歌不尽
清歌不尽 2020-12-07 09:24

We have Spring-boot/Hibernate/PostgreSQL application in our project and use Hikari as the connection pool. We keep running into the following problem: after few hours active

2条回答
  •  清歌不尽
    2020-12-07 09:51

    I managed to fix it finally. The problem is not related to HikariCP. The problem persisted because of some complex methods in REST controllers executing multiple changes in DB through JPA repositories. For some reasons calls to these interfaces resulted in a growing number of "freezed" active connections, exhausting the pool. Either annotating these methods as @Transactional or enveloping all the logic in a single call to transactional service method seem to solve the problem.

提交回复
热议问题