我无法在任何地方找到网络 我如何启用连接监视的代码示例 因为我在日志中收到此消息
153624 [com.google.common.base.internal.Finalizer] WARN
com.jolbox.bonecp.ConnectionPartition - BoneCP detected
an unclosed connection and will now attempt to close it
for you. You should be closing this connection in your
application - enable connectionWatch for additional debugging assistance.
这是我的定义:
BoneCPConfig config = new BoneCPConfig();
Class.forName(loc.driver); // load the DB driver
config.setJdbcUrl(loc.url); // set the JDBC url
config.setUsername(loc.user); // set the username
config.setPassword(loc.password); // set the password
config.setMinConnectionsPerPartition(5);
config.setMaxConnectionsPerPartition(10);
config.setPartitionCount(5);
config.setAcquireIncrement(5);
//config.setCloseConnectionWatch(true);
connectionPool = new BoneCP(config);
我也使用了:
config.setCloseConnectionWatch(true);
但它没有给我额外的调试帮助。
答案 0 :(得分:1)
我意识到这已经过时且可能已经解决,但要获取调试信息,您还需要设置setCloseConnectionWatchTimeout
或setCloseConnectionWatchTimeoutinMs
。