mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
dup close log configuable
This commit is contained in:
@@ -56,10 +56,12 @@ public class PoolableConnection implements PooledConnection, Connection {
|
||||
protected Connection conn;
|
||||
protected ConnectionHolder holder;
|
||||
protected TransactionInfo transactionInfo;
|
||||
private final boolean dupCloseLogEnable;
|
||||
|
||||
public PoolableConnection(ConnectionHolder holder){
|
||||
this.conn = holder.getConnection();
|
||||
this.holder = holder;
|
||||
dupCloseLogEnable = holder.getDataSource().isDupCloseLogEnable();
|
||||
}
|
||||
|
||||
public SQLException handleException(Throwable t) throws SQLException {
|
||||
@@ -115,7 +117,7 @@ public class PoolableConnection implements PooledConnection, Connection {
|
||||
public void close() throws SQLException {
|
||||
ConnectionHolder holder = this.holder;
|
||||
|
||||
if (holder == null) {
|
||||
if (holder == null && dupCloseLogEnable) {
|
||||
LOG.error("dup close");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user