support ayncCloseConnectionEnable

This commit is contained in:
wenshao
2014-08-21 16:57:00 +08:00
parent 365e7b156f
commit 17f08c1e17
3 changed files with 1292 additions and 1187 deletions
@@ -236,6 +236,8 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
protected long timeBetweenLogStatsMillis;
protected DruidDataSourceStatLogger statLogger = new DruidDataSourceStatLoggerImpl();
private boolean asyncCloseConnectionEnable = false;
public DruidAbstractDataSource(boolean lockFair){
lock = new ReentrantLock(lockFair);
@@ -1676,7 +1678,21 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
to.dupCloseLogEnable = this.dupCloseLogEnable;
to.isOracle = this.isOracle;
to.useOracleImplicitCache = this.useOracleImplicitCache;
to.asyncCloseConnectionEnable = this.asyncCloseConnectionEnable;
}
public abstract void discardConnection(Connection realConnection);
public boolean isAsyncCloseConnectionEnable() {
if (isRemoveAbandoned()) {
return true;
}
return asyncCloseConnectionEnable;
}
public void setAsyncCloseConnectionEnable(boolean asyncCloseConnectionEnable) {
this.asyncCloseConnectionEnable = asyncCloseConnectionEnable;
}
public abstract void discardConnection(Connection realConnection);
}