(or (with-process-lock ((conn-pool-lock pool) "Acquire from pool")
(when (plusp (length (free-connections pool)))
(let ((pconn (vector-pop (free-connections pool))))
;; test if connection still valid.
;; (e.g. db reboot -> invalid connection )
(handler-case
(or (with-process-lock ((conn-pool-lock pool) "Acquire from pool")
(when (plusp (length (free-connections pool)))
(let ((pconn (vector-pop (free-connections pool))))
;; test if connection still valid.
;; (e.g. db reboot -> invalid connection )
(handler-case