mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for useGloalDataSourceStat
This commit is contained in:
@@ -473,13 +473,13 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
|
||||
if (isUseGloalDataSourceStat()) {
|
||||
dataSourceStat = JdbcDataSourceStat.getGlobal();
|
||||
if (dataSourceStat.getDbType() == null) {
|
||||
dataSourceStat.setDbType(this.getDbType());
|
||||
}
|
||||
if (dataSourceStat == null) {
|
||||
dataSourceStat = new JdbcDataSourceStat("Global", "Global", this.dbType);
|
||||
JdbcDataSourceStat.setGlobal(dataSourceStat);
|
||||
}
|
||||
if (dataSourceStat.getDbType() == null) {
|
||||
dataSourceStat.setDbType(this.getDbType());
|
||||
}
|
||||
} else {
|
||||
dataSourceStat = new JdbcDataSourceStat(this.name, this.jdbcUrl, this.dbType);
|
||||
}
|
||||
|
||||
@@ -71,8 +71,8 @@ public class JdbcDataSourceStat implements JdbcDataSourceStatMBean {
|
||||
private final AtomicLong blobOpenCount = new AtomicLong();
|
||||
|
||||
private static JdbcDataSourceStat global = new JdbcDataSourceStat(
|
||||
"global",
|
||||
"global");
|
||||
"Global",
|
||||
"Global");
|
||||
|
||||
public static JdbcDataSourceStat getGlobal() {
|
||||
return global;
|
||||
|
||||
Reference in New Issue
Block a user