is there a way to specify a timeout for next.jdbc/get-connection
?
actually, i might be experiencing some other kind of timeout, since im accessing my db server over a ssh socks proxy which is tunnelled to my machine also over ssh this is my proxy handling code, if anyone is curious:
(defn proxy-props [& [props]]
(->> (or props (System/getProperties))
(filter #(str/includes? (key %) "Proxy"))
(into {})))
(defn activate-socks-proxy! [host port]
(proxy-props
(doto ^Properties (System/getProperties)
(.setProperty "socksProxyHost" host)
(.setProperty "socksProxyPort" (str port)))))
(defn deactivate-socks-proxy! []
(proxy-props
(doto ^Properties (System/getProperties)
(.remove "socksProxyHost")
(.remove "socksProxyPort"))))
(comment
(proxy-props)
(activate-socks-proxy! "localhost" 1081)
(deactivate-socks-proxy!)
)
You should be able to specify :loginTimeout
in the db spec used to create the datasource (that you then get the connection from) @onetom
On a statement level, you can specify :timeout
in the options (anywhere a prepared statement would be created and executed) -- that one is in the documentation (see *All the Options* and elsewhere).
The former -- :loginTimeout
-- is not specifically documented, but I believe the docs explain that arbitrary options can be passed through to the get connection process from the db spec hash map?
Yes, the arbitrary option passing is explained, I just didn't have the intuition what to google for, since I'm not familiar with the JDBC ecosystem...
Yes, I found that and it was clearly explained; no issue there
Thanks! So I guess I have to read the various JDBC adapter's documentation to figure out what kind of options do they support.