C3P0:池已满
C3P0: pool is already maxed out
谁能告诉我这是什么意思?我最近将几乎所有代码都转换为 try-with-resources,这样清理连接的问题就更少了。我假设我超出了 C3P0 无需额外配置即可处理的连接数。这里主要是单线程的。这里有另一个线程在工作,但我确实有代码在完成后关闭连接。我正在尝试查看我的日志文件以查找在 C3P0 达到最大值之前发生了 15 次的事情。现在我的程序似乎已挂起,并且没有为其执行新工作。
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
您可能正在泄漏连接,即没有可靠地确保每次打开连接时连接都关闭。你应该使用像 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.
这样的结构
谁能告诉我这是什么意思?我最近将几乎所有代码都转换为 try-with-resources,这样清理连接的问题就更少了。我假设我超出了 C3P0 无需额外配置即可处理的连接数。这里主要是单线程的。这里有另一个线程在工作,但我确实有代码在完成后关闭连接。我正在尝试查看我的日志文件以查找在 C3P0 达到最大值之前发生了 15 次的事情。现在我的程序似乎已挂起,并且没有为其执行新工作。
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
您可能正在泄漏连接,即没有可靠地确保每次打开连接时连接都关闭。你应该使用像 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.
这样的结构