C3P0: pool is already maxed out

Tags: ,



Can someone tell me what this means? I recently converted almost all of my code to try-with-resources so that cleanup of connections would be less problematic. I’m assuming that I’m out of the number of connections that C3P0 will handle without additional configuration. This is a mostly single threaded thing here. There is another thread at work here but I do have code in there to close the connection when done. I’m trying to look through my log file to find something that happened 15 times before C3P0 maxed out. Now my program appears to be hung and is not picking up new work for it to do.

2020-04-28 14:17:12 [DEBUG] [main] - acquire test -- pool is already maxed out. [managed: 15; max: 15]
2020-04-28 14:17:12 [DEBUG] [main] - awaitAvailable(): com.mchange.v2.c3p0.impl.NewPooledConnection@c1997cd
2020-04-28 14:17:42 [DEBUG] [RepostWatcher] - acquire test -- pool is already maxed out. [managed: 15; max: 15]
2020-04-28 14:17:42 [DEBUG] [RepostWatcher] - awaitAvailable(): com.mchange.v2.c3p0.impl.NewPooledConnection@c1997cd

Answer

You likely are leaking connections, ie not robustly ensuring that connections are closed each time you open them. You should be using a construct like try with resources whenever you acquire a connection. If you need to debug where in your codebase connections are opened that may not have been closed, see the docs here.



Source: stackoverflow