mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
add dynamic change maxActive support
This commit is contained in:
@@ -252,6 +252,14 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
if (this.maxActive == maxActive) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (maxActive < this.minIdle) {
|
||||
throw new IllegalArgumentException("maxActive less than minIdle, " + maxActive + " < " + this.minIdle);
|
||||
}
|
||||
|
||||
if (maxActive == 0) {
|
||||
throw new IllegalArgumentException("maxActive can't not set zero");
|
||||
}
|
||||
|
||||
if (!inited) {
|
||||
this.maxActive = maxActive;
|
||||
@@ -259,7 +267,7 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
}
|
||||
|
||||
if (LOG.isInfoEnabled()) {
|
||||
LOG.info("set maxActive " + this.maxActive + " -> " + maxActive);
|
||||
LOG.info("maxActive modified : " + this.maxActive + " -> " + maxActive);
|
||||
}
|
||||
|
||||
lock.lock();
|
||||
|
||||
Reference in New Issue
Block a user