Skip to content

Commit d1abeaa

Browse files
author
Keiichi Fujino
committed
Eliminate the dependence on maxActive of busy queues and idle queue in order to enable the expansion of the pool size via JMX.
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1692372 13f79535-47bb-0310-9956-ffa450edef68
1 parent 89053c9 commit d1abeaa

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import java.util.Set;
3030
import java.util.Timer;
3131
import java.util.TimerTask;
32-
import java.util.concurrent.ArrayBlockingQueue;
3332
import java.util.concurrent.BlockingQueue;
3433
import java.util.concurrent.CountDownLatch;
3534
import java.util.concurrent.ExecutionException;
@@ -439,7 +438,7 @@ protected void init(PoolConfiguration properties) throws SQLException {
439438
}
440439

441440
//make space for 10 extra in case we flow over a bit
442-
busy = new ArrayBlockingQueue<>(properties.getMaxActive(),false);
441+
busy = new LinkedBlockingQueue<>();
443442
//busy = new FairBlockingQueue<PooledConnection>();
444443
//make space for 10 extra in case we flow over a bit
445444
if (properties.isFairQueue()) {
@@ -448,7 +447,7 @@ protected void init(PoolConfiguration properties) throws SQLException {
448447
//idle = new LinkedTransferQueue<PooledConnection>();
449448
//idle = new ArrayBlockingQueue<PooledConnection>(properties.getMaxActive(),false);
450449
} else {
451-
idle = new ArrayBlockingQueue<>(properties.getMaxActive(),properties.isFairQueue());
450+
idle = new LinkedBlockingQueue<>();
452451
}
453452

454453
initializePoolCleaner(properties);

0 commit comments

Comments
 (0)