如何正确配置 hibernate.c3p0.debugUnreturnedConnectionStackTraces

问题描述

几乎到处搜索解决方案,但没有找到任何方向。我希望为 c3p0 连接池的未返回连接堆栈跟踪打印调试日志。除了 c3p0 的其他属性外,我在 hibernate 的配置中设置了以下属性

Array.Fill

其他属性

          <beans:prop key="hibernate.c3p0.unreturnedConnectionTimeout">30</beans:prop>
          <beans:prop key="hibernate.c3p0.debugUnreturnedConnectionStackTraces">true</beans:prop>

其他属性在 spring 容器初始化时打印在日志中

            <beans:prop key="hibernate.generate_statistics">true</beans:prop>
            <beans:prop key="hibernate.c3p0.min_size">5</beans:prop>
            <beans:prop key="hibernate.c3p0.max_size">20</beans:prop>
            <beans:prop key="hibernate.c3p0.timeout">300</beans:prop>
            <beans:prop key="hibernate.c3p0.max_statements">50</beans:prop>
            <beans:prop key="hibernate.c3p0.idle_test_period">3000</beans:prop>

但是对于所有未返回的连接,我无法看到任何相关的日志。

这是我在 log4j.xml 中的其他配置

             com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource - Initializing c3p0 pool... 
             com.mchange.v2.c3p0.PoolBackedDataSource@22c564ca [ connectionPoolDataSource -> 
             com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@2e5953fe [ acqui...

有什么我需要配置的地方吗?请帮忙。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)