private void blockUntilAvailable() {
            if (closed) {
                throw new IllegalStateException("This connection has already been closed.");
            }

            if (!available) {
                LOGGER_CONNECTION.debug("Aquiring connection");
                try {
                    if (!lock.tryAcquire()) {
                        if (blocking) {
                            LOGGER_CONNECTION.warn("Waiting for connection to become available...");
                            lock.acquire();
                        } else {
                            throw new SpeedmentException(
                                "Error! No connection available. Try " +
                                "wrapping the expression in a transaction or " +
                                "enable the Speedment parameter " +
                                "'connectionpool.blocking=true'.");
                        }
                    }
                } catch (final InterruptedException ex) {
                    try {
                        throw new SpeedmentException(
                            "Interrupted while waiting for available connection.", ex);
                    } finally {
                        Thread.currentThread().interrupt();
                    }
                }
                this.counter.incrementAndGet();
                available = true;
            }
        }
Configuration parameter that controls if a request for a new connection
should be queued until one becomes available or if it should cause an
exception to be thrown if no connection is available.
runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/component/connectionpool/SingletonConnectionPoolComponent.java