Skip to content

Commit 5d095d5

Browse files
committed
Remove ability to modify minConnections at runtime
This was not publically exposed so more removing an unused method.
1 parent 2c410e6 commit 5d095d5

File tree

2 files changed

+6
-26
lines changed

2 files changed

+6
-26
lines changed

ebean-datasource/src/main/java/io/ebean/datasource/pool/ConnectionPool.java

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ final class ConnectionPool implements DataSourcePool {
7171
private final AtomicBoolean dataSourceUp = new AtomicBoolean(false);
7272
private SQLException dataSourceDownReason;
7373
private final AtomicBoolean inWarningMode = new AtomicBoolean();
74-
private int minConnections;
74+
private final int minConnections;
7575
private int maxConnections;
7676
private int warningSize;
7777
private final int waitTimeoutMillis;
@@ -197,8 +197,8 @@ private void initialiseConnections() throws SQLException {
197197
}
198198

199199
final var ro = readOnly ? "readOnly[true] " : "";
200-
Log.info("DataSource [{0}] {1}autoCommit[{2}] transIsolation[{3}] min[{4}] max[{5}] in[{6}ms]",
201-
name, ro, autoCommit, description(transactionIsolation), minConnections, maxConnections, (System.currentTimeMillis() - start));
200+
Log.info("DataSource [{0}] {1}autoCommit[{2}] [{3}] min[{4}] max[{5}] in[{6}ms]",
201+
name, ro, autoCommit, description(transactionIsolation), minConnections, maxConnections, (System.currentTimeMillis() - start), validateOnHeartbeat);
202202
}
203203

204204
/**
@@ -443,22 +443,14 @@ public void setMaxSize(int max) {
443443
/**
444444
* Return the max size this pool can grow to.
445445
*/
446-
public int getMaxSize() {
446+
int getMaxSize() {
447447
return maxConnections;
448448
}
449449

450-
/**
451-
* Set the min size this pool should maintain.
452-
*/
453-
public void setMinSize(int min) {
454-
queue.setMinSize(min);
455-
this.minConnections = min;
456-
}
457-
458450
/**
459451
* Return the min size this pool should maintain.
460452
*/
461-
public int getMinSize() {
453+
int getMinSize() {
462454
return minConnections;
463455
}
464456

ebean-datasource/src/main/java/io/ebean/datasource/pool/PooledConnectionQueue.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ final class PooledConnectionQueue {
3737
private final long waitTimeoutMillis;
3838
private final long leakTimeMinutes;
3939
private final long maxAgeMillis;
40+
private final int minSize;
4041
private int warningSize;
4142
private int maxSize;
42-
private int minSize;
4343
/**
4444
* Number of threads in the wait queue.
4545
*/
@@ -115,18 +115,6 @@ PoolStatus status(boolean reset) {
115115
}
116116
}
117117

118-
void setMinSize(int minSize) {
119-
lock.lock();
120-
try {
121-
if (minSize > this.maxSize) {
122-
throw new IllegalArgumentException("minSize " + minSize + " > maxSize " + this.maxSize);
123-
}
124-
this.minSize = minSize;
125-
} finally {
126-
lock.unlock();
127-
}
128-
}
129-
130118
void setMaxSize(int maxSize) {
131119
lock.lock();
132120
try {

0 commit comments

Comments
 (0)