gpt4 book ai didi

c3p0 - 为什么 c3p0 中的 numUnclosedOrphanedConnections 增加了?

转载 作者:行者123 更新时间:2023-12-01 18:50:00 25 4
gpt4 key购买 nike

我正在使用 c3p0 (0.9.1.2) 版本,大约一个小时后,我看到 numUnclosedOrphanedConnections 像每小时 1 个一样缓慢增加。 c3p0 文档说

numUnclosedOrphanedConnections will only be non-zero following a call to softReset(). It represents the number of Connections that were checked out when a soft reset occurred and were therefore silently excluded from the pool, and which remain unclosed by the client application.

为什么c3p0做软复位?我的 c3p0 设置是这样的

initialPoolSize=1
minPoolSize=1
maxPoolSize=100
maxIdleTime=60
checkoutTimeout=5000
testConnectionOnCheckin=true

最佳答案

感谢 Steve 帮助我修复它。我就是这样做的。

为 c3po 启用调试级别日志记录:

<logger name="com.mchange" additivity="false">
<level value="DEBUG" />
<appender-ref ref="C3p0Appender" />
</logger>

c3p0 设置:

debugUnreturnedConnectionStackTraces=true
# 30 sec is enough for me but you should change it for your case
unreturnedConnectionTimeout=30

在c3p0日志文件中搜索的关键字是:“Overdue resource check-out”

此日志记录仅在 c3p0 的主干版本中启用。它应该在 pre6 版本中存在。

关于c3p0 - 为什么 c3p0 中的 numUnclosedOrphanedConnections 增加了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13070616/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com