//||maxFreeConnections < optimalFreeConnections
//||optimalFreeConnections < minFreeConnections
|| maxFreeConnections < initialConnections
|| initialConnections < minFreeConnections) {
throw new JDBCRepositoryException(EXCEPTION_LOCALIZER.format(
"jdbc-pool-invalid-configuration", new Integer[]{
new Integer(maxConnections),
new Integer(maxFreeConnections),
new Integer(initialConnections),
new Integer(minFreeConnections)
}));
}
listener = new PooledConnectionListener();
try {
for (int c = 0; c < initialConnections; c += 1) {
PooledConnection pooledConnection = createPooledConnection();
freeConnections.add(pooledConnection);
}
} catch (SQLException sqle) {
logger.error("sql-exception", sqle);
throw new JDBCRepositoryException(sqle);
}
backgroundThread = new BackgroundThread();
backgroundThread.setDaemon(true);
backgroundThread.start();