-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Upon object creation & pool closing, the validate & destroy functions aren't called as expected.
Reproducing the error
(defn create-pool [count]
(doto (pool/get-pool (fn [] (println "creating an object") 1)
{:validate (fn [x] (println "validate called") true)
:destroy (fn [x] (println "destroy called"))})
(.setTimeBetweenEvictionRunsMillis 1)
(.setMinIdle count)
(.setMaxIdle count)
(.setMaxTotal count)))
;; Immediately 2 objects will get created as `setMinIdle` is set to 2.
(let [my-pool (create-pool 2)]
(Thread/sleep 100)
(pool/close my-pool))When executing above code, "validate called" & "destroy called" won't get printed
Metadata
Metadata
Assignees
Labels
No labels