DBCP object created 2010-12-11 11:08:00 by the following code was never closed:
java.lang.Exception
at org.apache.tomcat.dbcp.dbcp.AbandonedTrace.setStackTrace(AbandonedTrace.java:160)
at org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java:86)
at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
DBCP object created 2010-12-11 11:08:00 by the following code was never closed:
java.lang.Exception
at org.apache.tomcat.dbcp.dbcp.AbandonedTrace.init(AbandonedTrace.java:99)
at org.apache.tomcat.dbcp.dbcp.AbandonedTrace.<init>(AbandonedTrace.java:82)
at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.<init>(DelegatingStatement.java:61)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.<init>(DelegatingPreparedStatement.java:66)
at org.apache.tomcat.dbcp.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:262)
这是removeAbandoned=true导致的,使用这个配置的时候将会使用AbandonedObjectPool.
而AbandonedObjectPool只在开发阶段使用,因为AbandonedObjectPool能帮你发现占用连接过长的代码
log信息说明了getCustomerOnline占用连接超过removeAbandonedTimeout设定的时间.所以设置removeAbandoned=false就行了。