mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for tomcat 7 memory leak warnnings
This commit is contained in:
@@ -1164,9 +1164,13 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
|
||||
protected boolean testConnectionInternal(Connection conn) {
|
||||
String sqlFile = JdbcSqlStat.getContextSqlFile();
|
||||
String sqlName = JdbcSqlStat.getContextSqlName();
|
||||
|
||||
JdbcSqlStat.setContextSqlFile(null);
|
||||
JdbcSqlStat.setContextSqlName(null);
|
||||
|
||||
if (sqlFile != null) {
|
||||
JdbcSqlStat.setContextSqlFile(null);
|
||||
}
|
||||
if (sqlName != null) {
|
||||
JdbcSqlStat.setContextSqlName(null);
|
||||
}
|
||||
try {
|
||||
if (validConnectionChecker != null) {
|
||||
return validConnectionChecker.isValidConnection(conn, validationQuery, validationQueryTimeout);
|
||||
@@ -1201,8 +1205,12 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
|
||||
// skip
|
||||
return false;
|
||||
} finally {
|
||||
JdbcSqlStat.setContextSqlFile(sqlFile);
|
||||
JdbcSqlStat.setContextSqlName(sqlName);
|
||||
if (sqlFile != null) {
|
||||
JdbcSqlStat.setContextSqlFile(sqlFile);
|
||||
}
|
||||
if (sqlName != null) {
|
||||
JdbcSqlStat.setContextSqlName(sqlName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user