code: public synchronized ConnectionWrapper checkOut() throws SQLException {
          final Transaction tx = getTransaction();
          if (tx == null && isSuppressLocalTx()) { // rare case
              throw new LjtIllegalStateException("Not begun transaction. (not allowed local transaction)");
          }
          ConnectionWrapper wrapper = getConnectionTxActivePool(tx);
          if (wrapper != null) {
              if (isInternalDebug()) {
                  logger.debug("#fw_debug ...Checking out logical connection from pool: {}", tx);
              }
              wrapper.saveCheckOutHistory();
              return wrapper;
          }
          long wait = maxWait;
          while (getMaxPoolSize() > 0 && getActivePoolSize() + getTxActivePoolSize() >= getMaxPoolSize()) {
              if (wait == 0L) {
                  throwConnectionPoolShortFreeException(); // *extension
              }
              final long startTime = System.currentTimeMillis();
              try {
                  wait((maxWait == -1L) ? 0L : wait);
              } catch (InterruptedException e) { // rare case
                  throw new LjtSQLException("Cannot wait the connection back to pool", e);
              }
              final long elapseTime = System.currentTimeMillis() - startTime;
              if (wait > 0L) {
                  wait -= Math.min(wait, elapseTime);
              }
          }
          wrapper = checkOutFreePool(tx);
          if (wrapper == null) {
              wrapper = createConnection(tx);
          }
          if (tx == null) {
              setConnectionActivePool(wrapper);
          } else {
              LjtTransactionUtil.enlistResource(tx, wrapper.getXAResource());
              LjtTransactionUtil.registerSynchronization(tx, createSynchronizationImpl(tx));
              setConnectionTxActivePool(tx, wrapper);
          }
          wrapper.setReadOnly(readOnly);
          if (transactionIsolationLevel != DEFAULT_TRANSACTION_ISOLATION_LEVEL) {
              wrapper.setTransactionIsolation(transactionIsolationLevel);
          }
          if (isInternalDebug()) {
              logger.debug("#fw_debug ...Checking out logical connection from pool: {}", tx);
          }
          wrapper.saveCheckOutHistory();
          return wrapper;
      }
docs: =========