improve compatible for DBCP

This commit is contained in:
wenshao
2012-10-20 05:08:04 +08:00
parent 3c04c2d06b
commit 26e3fa3987
5 changed files with 53 additions and 4 deletions
@@ -165,6 +165,22 @@ public class DruidPooledConnection implements javax.sql.PooledConnection, Connec
public boolean isDisable() {
return disable;
}
public void discard() {
if (this.disable) {
return;
}
DruidConnectionHolder holder = this.holder;
if (holder == null) {
if (dupCloseLogEnable) {
LOG.error("dup close");
}
return;
}
holder.getDataSource().discardConnection(holder.getConnection());
}
@Override
public void close() throws SQLException {