0

Is it possible to set HikariCP a maximum pool size as a soft limit?

What I mean by that is that I want HikariCP to use max 5 connections. However when a 6th connection should be requested, I want HikariCP to create a 6th connection that will be destroyed after I return it to the pool. Additionally it would be nice if HikariCP would inform me, that an additional connection was created because all the connections in the pool were already in use.

mvieghofer
  • 2,846
  • 4
  • 22
  • 51
  • 1
    What would this accomplish over having a maximum of 6 connections? Besides lowering the performance for having to create and destroy connections. – Kayaman Jan 12 '15 at 12:50
  • @Kayaman The reason why we need this is because we switched to hikariCP for our application. Its a huge code base and the connection handling isn't always implemented as it should be. The reason why I need such a behavior is to become aware of possible connection leaks and fixing them without breaking the app. – mvieghofer Jan 12 '15 at 12:57
  • @mvieghofer If you are looking for leaks, I suggest enabling the leak detection feature of HikariCP. Otherwise, what you are asking for is quite unique and you are unlikely to find any pool that supports that kind of behavior. – brettw Jan 13 '15 at 00:38
  • @brettw yes I did this already and it works! Thanks! – mvieghofer Jan 13 '15 at 11:54

1 Answers1

0

I didn't really solve this problem. However, using the leak detection feature of hikariCP helps us finding connection leaks. This should help us solving the real problem.

mvieghofer
  • 2,846
  • 4
  • 22
  • 51