@ExecuteBefore(State.STOPPED)
    public void closeOpenConnections() {
        leasedConnections.values().forEach(conn -> {
            try {
                if (!conn.isClosed()) {
                    conn.close();
                    LOGGER_CONNECTION.warn("Leased connection had to be closed automatically.");
                }
            } catch (final SQLException ex) {
                throw new SpeedmentException(ex);
            }
        });

        pools.values().forEach(queue -> {
            PoolableConnection conn;
            while ((conn = queue.poll()) != null) {
                try {
                    if (!conn.isClosed()) {
                        conn.rawClose();
                    }
                } catch (final SQLException ex) {
                    throw new SpeedmentException("Error closing connection.", ex);
                }
            }
        });
    }
A fully concurrent implementation of a connection pool.

@author Per Minborg
runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/ConnectionPoolComponentImpl.java