1

I can't find anywhere is web code example to how i enable the connection watch because i get this message in log

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.

this is my definition:

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

i also used the:

 config.setCloseConnectionWatch(true);

but it didn't give me additional debugging assistance.

user502967
  • 327
  • 1
  • 3
  • 13

1 Answers1

1

I realize this is old and likely already resolved, but to get your debug information you also need to set the setCloseConnectionWatchTimeout or setCloseConnectionWatchTimeoutinMs.

Mark Seemann
  • 225,310
  • 48
  • 427
  • 736
Keith Rockhold
  • 124
  • 1
  • 6
  • I'm pretty sure it's always helpful to add answers, no matter how old the questions are (provided the answers are helpful). This certainly helped me. – DonyorM Nov 12 '15 at 14:44