Skip to content

Commit 209b298

Browse files
committed
Add support for initialConnections, tidy up
1 parent bb82964 commit 209b298

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

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

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ private int totalConnections() {
131131
return freeList.size() + busyList.size();
132132
}
133133

134-
void createConnections(int count) throws SQLException {
134+
void createConnections(int numberToAdd) throws SQLException {
135135
lock.lock();
136136
try {
137-
for (int i = 0; i < count; i++) {
137+
for (int i = 0; i < numberToAdd; i++) {
138138
freeList.add(pool.createConnectionForQueue(connectionId++));
139139
}
140140
notEmpty.signal();
@@ -143,18 +143,6 @@ void createConnections(int count) throws SQLException {
143143
}
144144
}
145145

146-
// void ensureMinimumConnections() throws SQLException {
147-
// lock.lock();
148-
// try {
149-
// int add = minSize - totalConnections();
150-
// if (add > 0) {
151-
// createConnections(add);
152-
// }
153-
// } finally {
154-
// lock.unlock();
155-
// }
156-
// }
157-
158146
/**
159147
* Return a PooledConnection.
160148
*/
@@ -374,7 +362,6 @@ void trim(long maxInactiveMillis, long maxAgeMillis) {
374362
if (add > 0) {
375363
createConnections(add);
376364
}
377-
//ensureMinimumConnections();
378365
} catch (SQLException e) {
379366
Log.error("Error trying to ensure minimum connections", e);
380367
}

0 commit comments

Comments
 (0)