bug fixed for useGloalDataSourceStat

This commit is contained in:
wenshao
2013-05-10 02:44:56 +08:00
parent dc45b9d57e
commit bbb5e6f983
3 changed files with 6 additions and 5 deletions
@@ -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;