This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-11
Channels
- # adventofcode (8)
- # announcements (1)
- # arachne (23)
- # beginners (146)
- # boot (4)
- # calva (2)
- # cider (48)
- # cljs-dev (17)
- # clojure (214)
- # clojure-austin (2)
- # clojure-berlin (1)
- # clojure-europe (9)
- # clojure-italy (5)
- # clojure-nl (2)
- # clojure-sanfrancisco (2)
- # clojure-spec (124)
- # clojure-uk (67)
- # clojured (3)
- # clojurescript (95)
- # community-development (7)
- # cursive (68)
- # data-science (1)
- # datomic (80)
- # emacs (19)
- # figwheel (3)
- # figwheel-main (5)
- # fulcro (61)
- # javascript (2)
- # kaocha (1)
- # off-topic (25)
- # pathom (21)
- # pedestal (1)
- # perun (4)
- # reitit (11)
- # ring-swagger (2)
- # shadow-cljs (55)
- # spacemacs (4)
- # sql (8)
- # test-check (16)
- # tools-deps (2)
- # vim (13)
- # yada (4)
Hello @seancorfield, insert-multi! fn did the insert in one statement after we upgraded mariadb version to 10.3.11 and changed "org.mariadb.jdbc/mariadb-java-client" dependency version to "2.4.0". Thanks again!
Good to know! Thank you. I suspected it might be a driver issue (since that aspect of behavior is out of the control of java.jdbc
.
What is the difference between querying directly with jdbc/query
on a hikaricp connection pool and wrapping that call in a with-db-connection
?
How could it lead to solving a SocketTimeoutException? https://github.com/brettwooldridge/HikariCP/issues/811#issuecomment-344206104
Without seeing the OP's code, it's impossible to say what they were doing wrong.
It sounds like they were getting a connection from the pool and then handing it around their app and thus making it long-lived -- and so it was getting closed. If you have a connection pool (your db-spec
is a hash map containing :datasource <pooled datasource>
) you can use that directly in jdbc/query
and it will get a new connection, run the query, and then close the connection.
In that situation, wrapping code in with-db-connection
should make no difference.
We use c3p0 at work and our db-spec
is a hash map containing :datasource
with a c3p0 PooledDatasource object and we pass that hash map directly to jdbc/query
all over the place in a highly concurrent, high-traffic app and it's never a problem. Which is why I believe the OP was doing something wrong 😐