簡體   English   中英

java bonecp連接池處理問題

[英]java bonecp connection-pool handling issue

我找不到如何啟用連接監視的Web代碼示例,因為我在日志中收到此消息

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);

但這並沒有給我額外的調試幫助。

我知道這很舊並且可能已經解決,但是要獲取調試信息,您還需要設置setCloseConnectionWatchTimeoutsetCloseConnectionWatchTimeoutinMs

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM