mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
代码重构
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@515 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -261,7 +261,8 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
LOG.debug("skip not validate connection.");
|
||||
}
|
||||
|
||||
poolalbeConnection.close(false);
|
||||
Connection realConnection = poolalbeConnection.getConnection();
|
||||
JdbcUtils.close(realConnection);
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
@@ -272,6 +273,11 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
}
|
||||
}
|
||||
|
||||
if (isRemoveAbandoned()) {
|
||||
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
|
||||
activeConnections.put(poolalbeConnection, new ActiveConnectionTraceInfo(poolalbeConnection, System.currentTimeMillis(), stackTrace));
|
||||
}
|
||||
|
||||
return poolalbeConnection;
|
||||
}
|
||||
}
|
||||
@@ -311,11 +317,6 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
activeCount++;
|
||||
|
||||
poolalbeConnection = new PoolableConnection(holder);
|
||||
|
||||
if (isRemoveAbandoned()) {
|
||||
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
|
||||
activeConnections.put(poolalbeConnection, new ActiveConnectionTraceInfo(poolalbeConnection, System.currentTimeMillis(), stackTrace));
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
connectErrorCount++;
|
||||
throw new SQLException(e.getMessage(), e);
|
||||
|
||||
Reference in New Issue
Block a user