mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -102,6 +102,18 @@ public class StatFilter extends FilterEventAdapter implements StatFilterMBean {
|
||||
return slowSqlMillis;
|
||||
}
|
||||
|
||||
public void setSlowSqlMillis(long slowSqlMillis) {
|
||||
this.slowSqlMillis = slowSqlMillis;
|
||||
}
|
||||
|
||||
public boolean isLogSlowSql() {
|
||||
return logSlowSql;
|
||||
}
|
||||
|
||||
public void setLogSlowSql(boolean logSlowSql) {
|
||||
this.logSlowSql = logSlowSql;
|
||||
}
|
||||
|
||||
public boolean isConnectionStackTraceEnable() {
|
||||
return connectionStackTraceEnable;
|
||||
}
|
||||
|
||||
@@ -215,11 +215,15 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
|
||||
|
||||
protected boolean useOracleImplicitCache = true;
|
||||
|
||||
protected final ReentrantLock lock = new ReentrantLock(true);
|
||||
protected final ReentrantLock lock;
|
||||
|
||||
protected AtomicLong createCount = new AtomicLong();
|
||||
protected AtomicLong destroyCount = new AtomicLong();
|
||||
|
||||
public DruidAbstractDataSource(boolean lockFair){
|
||||
lock = new ReentrantLock(lockFair);
|
||||
}
|
||||
|
||||
public boolean isOracle() {
|
||||
return isOracle;
|
||||
}
|
||||
@@ -563,7 +567,7 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
|
||||
}
|
||||
|
||||
public void setRemoveAbandonedTimeout(int removeAbandonedTimeout) {
|
||||
this.removeAbandonedTimeoutMillis = (long)removeAbandonedTimeout * 1000;
|
||||
this.removeAbandonedTimeoutMillis = (long) removeAbandonedTimeout * 1000;
|
||||
}
|
||||
|
||||
public void setRemoveAbandonedTimeoutMillis(long removeAbandonedTimeoutMillis) {
|
||||
@@ -923,9 +927,9 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
|
||||
|
||||
this.jdbcUrl = jdbcUrl;
|
||||
|
||||
// if (jdbcUrl.startsWith(ConfigFilter.URL_PREFIX)) {
|
||||
// this.filters.add(new ConfigFilter());
|
||||
// }
|
||||
// if (jdbcUrl.startsWith(ConfigFilter.URL_PREFIX)) {
|
||||
// this.filters.add(new ConfigFilter());
|
||||
// }
|
||||
}
|
||||
|
||||
public String getDriverClassName() {
|
||||
|
||||
@@ -125,6 +125,11 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
private JdbcDataSourceStat dataSourceStat;
|
||||
|
||||
public DruidDataSource(){
|
||||
this(true);
|
||||
}
|
||||
|
||||
public DruidDataSource(boolean fairLock){
|
||||
super (fairLock);
|
||||
}
|
||||
|
||||
public String getInitStackTrace() {
|
||||
@@ -923,7 +928,7 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
}
|
||||
}
|
||||
|
||||
void putLast(DruidConnectionHolder e, long lastActiveTimeMillis) throws SQLException {
|
||||
void putLast(DruidConnectionHolder e, long lastActiveTimeMillis) {
|
||||
e.setLastActiveTimeMillis(lastActiveTimeMillis);
|
||||
connections[poolingCount++] = e;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user