This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-04
Channels
- # aleph (1)
- # aws-lambda (2)
- # beginners (30)
- # boot (2)
- # cider (7)
- # cljs-dev (65)
- # clojure (130)
- # clojure-denmark (1)
- # clojure-france (1)
- # clojure-germany (2)
- # clojure-greece (1)
- # clojure-italy (19)
- # clojure-kc (2)
- # clojure-nl (12)
- # clojure-poland (1)
- # clojure-russia (11)
- # clojure-spain (1)
- # clojure-spec (20)
- # clojure-uk (176)
- # clojurescript (65)
- # css (3)
- # cursive (8)
- # datomic (26)
- # editors (94)
- # emacs (10)
- # fulcro (66)
- # graphql (5)
- # midje (1)
- # off-topic (48)
- # om-next (2)
- # overtone (1)
- # re-frame (15)
- # reagent (6)
- # reitit (10)
- # shadow-cljs (68)
- # sql (3)
I’m running a simple ring/Jetty app with clojure.java.jdbc
wrapped with hikari-cp
for connection pooling. Sporadically I get this error:
...
my.handler/handle handler.clj:100
clojure.java.jdbc/db-transaction* jdbc.clj: 598
clojure.java.jdbc/db-transaction* jdbc.clj: 629
clojure.java.jdbc/db-transaction* jdbc.clj: 623
com.zaxxer.hikari.pool.HikariProxyConnection.setAutoCommit HikariProxyConnection.java
com.zaxxer.hikari.pool.ProxyConnection.setAutoCommit ProxyConnection.java: 388
com.sun.proxy.$Proxy11.setAutoCommit
com.zaxxer.hikari.pool.ProxyConnection$ClosedConnection.lambda$getClosedConnection$0 ProxyConnection.java: 489
java.sql.SQLException: Connection is closed
errorCode: 0
AFAICT this means that the connection is closed during the transaction, which I suspect can happen either if a transaction takes too long to complete or another thread has closed the connection.
Does anybody have any thoughts on how I can debug the issue further?I'm not familiar with Hikari -- we use c3p0 -- but I would expect you can adjust connection pool timeouts and so on. We had to spend a while tuning that stuff before we were happy in production (with MySQL).
@looveh Maybe you can share the Clojure code both for the with-db-transaction
that fails and for how you set up Hikari?