mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improve compatible for DBCP
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user