Creates a context in which the session is connected. Ensures the session is
disconnected on exit.
(defmacro with-connection
"Creates a context in which the session is connected. Ensures the session is
disconnected on exit."
[session & body]
`(let [session# ~session]
(try
(when-not (connected? session#)
(connect session#))
~@body
(finally (disconnect session#)))))
Comments top
No comments for with-connection. Log in to add a comment.