2828@ RequiredArgsConstructor
2929public final class SQLConnectionPool {
3030
31+ private final ISQLConnectionBuilder <? extends SQLDatabaseConnection > builder ;
32+ private final int maxConnections ;
33+ private final long borrowObjectTimeout ;
34+ private final boolean blockWhenExhausted ;
35+ private final boolean checkConnectionValidity ;
36+ private final int checkConnectionValidityTimeout ;
37+ private final ISQLDatabaseOptions connectionOptions ;
38+
39+ private volatile int errorCount = 0 ;
40+
41+ // --***-- Pooled connection caches --***--
42+ private final Queue <PooledSQLDatabaseConnection > freeConnections = new ConcurrentLinkedQueue <>();
43+ private final List <PooledSQLDatabaseConnection > usedConnections = new CopyOnWriteArrayList <>();
44+
3145 @ Data
3246 public static final class Options {
3347 // Max number of connections in the pool
@@ -43,20 +57,6 @@ public static final class Options {
4357 private ISQLDatabaseOptions connectionOptions = null ;
4458 }
4559
46- private final ISQLConnectionBuilder <? extends SQLDatabaseConnection > builder ;
47- private final int maxConnections ;
48- private final long borrowObjectTimeout ;
49- private final boolean blockWhenExhausted ;
50- private final boolean checkConnectionValidity ;
51- private final int checkConnectionValidityTimeout ;
52- private final ISQLDatabaseOptions connectionOptions ;
53-
54- private volatile int errorCount = 0 ;
55-
56- // --***-- Pooled connection caches --***--
57- private final Queue <PooledSQLDatabaseConnection > freeConnections = new ConcurrentLinkedQueue <>();
58- private final List <PooledSQLDatabaseConnection > usedConnections = new CopyOnWriteArrayList <>();
59-
6060 @ SuppressWarnings ("unused" )
6161 public SQLConnectionPool (final @ NotNull ISQLConnectionBuilder <? extends SQLDatabaseConnection > from ) {
6262 this (from , new Options ());
0 commit comments