C3PO Exception - CLOSE BY CLIENT

We are running a standalone application with Spring. We use a MySQL database. The datasource that has been configured is the "com.mchange.v2.c3p0.ComboPooledDataSource" from C3PO At regular interval :

 

  com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0 DEBUG 2011-04-01 10:27:47,009 BasicResourcePool$1DestroyResourceTask:run - Preparing to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@1eaf8ae
  com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0 DEBUG 2011-04-01 10:27:47,009 C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager:destroyResource - Preparing to destroy PooledConnection: com.mchange.v2.c3p0.impl.NewPooledConnection@1eaf8ae
  com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0 DEBUG 2011-04-01 10:27:47,009 GooGooStatementCache:closeAll - ENTER METHOD: closeAll( com.mysql.jdbc.JDBC4Connection@f5b5a6 )! -- num_connections: 0
  com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0 DEBUG 2011-04-01 10:27:47,009 GooGooStatementCache:closeAll - closeAll(): com.mchange.v2.c3p0.stmt.GlobalMaxOnlyStatementCache stats -- total size: 0; checked out: 0; num connections: 0; num keys: 0
  com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0 DEBUG 2011-04-01 10:27:47,010 NewPooledConnection:close - com.mchange.v2.c3p0.impl.NewPooledConnection@1eaf8ae closed by a client.
  java.lang.Exception: DEBUG -- CLOSE BY CLIENT STACK TRACE
  	at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:491)
  	at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:191)
  	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470)
  	at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)
  	at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
  com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0 DEBUG 2011-04-01 10:27:47,010 C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager:destroyResource - Successfully destroyed PooledConnection: com.mchange.v2.c3p0.impl.NewPooledConnection@1eaf8ae
  com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0 DEBUG 2011-04-01 10:27:47,010 BasicResourcePool$1DestroyResourceTask:run - Successfully destroyed resource: com.mchange.v2.c3p0.impl.NewPooledConnection@1eaf8ae
  com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1 DEBUG 2011-04-01 10:27:47,017 GooGooStatementCache:checkinAll - checkinAll(): com.mchange.v2.c3p0.stmt.GlobalMaxOnlyStatementCache stats -- total size: 0; checked out: 0; num connections: 0; num keys: 0
  com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1 DEBUG 2011-04-01 10:27:47,017 C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager:acquireResource - com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager@961df6.acquireResource() returning. 
  com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1 DEBUG 2011-04-01 10:27:47,017 BasicResourcePool:trace - trace com.mchange.v2.resourcepool.BasicResourcePool@d9fe20 [managed: 2, unused: 2, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@108d7cf)
  com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1 DEBUG 2011-04-01 10:27:47,017 BasicResourcePool:decrementPendingAcquires - decremented pending_acquires: 0

 

 

The implementation of close of NewPooledConnection is indeed a bit exotic.

public synchronized void close() throws SQLException
{
  close(null);
}

private void close(Throwable cause) throws SQLException
{
  ....
if(cause == null)
{
 invalidatingException = NORMAL_CLOSE_PLACEHOLDER;
 if(logger.isLoggable(MLevel.FINEST))
 logger.log(MLevel.FINEST, this + " closed by a client.", new Exception("DEBUG -- CLOSE BY CLIENT STACK TRACE"));
  ...
}

 

Indeed, there is nothing to worry about.
Just odd log statements sprinkled throughout the C3P0 codebase.
Raise the loglevel to INFO and these statemens will not appear anymore.
Have a nice holiday and happy coding.

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值