This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-18
Channels
- # aleph (7)
- # announcements (11)
- # beginners (186)
- # calva (17)
- # cider (26)
- # clj-kondo (4)
- # cljdoc (12)
- # cljs-dev (3)
- # clojars (1)
- # clojure (105)
- # clojure-berlin (1)
- # clojure-chicago (1)
- # clojure-dev (34)
- # clojure-europe (3)
- # clojure-italy (4)
- # clojure-nl (27)
- # clojure-russia (19)
- # clojure-uk (25)
- # clojuredesign-podcast (4)
- # clojurescript (54)
- # cursive (6)
- # data-science (1)
- # datascript (11)
- # datomic (5)
- # emacs (3)
- # events (2)
- # fulcro (13)
- # graalvm (5)
- # jobs (15)
- # leiningen (7)
- # luminus (3)
- # melbourne (1)
- # nrepl (1)
- # nyc (2)
- # onyx (4)
- # pathom (6)
- # pedestal (18)
- # re-frame (19)
- # reagent (10)
- # shadow-cljs (27)
- # spacemacs (32)
- # sql (11)
- # tools-deps (35)
- # vim (50)
Naming input please! I'm adding a feature to next.jdbc
that makes it easier to create connection pooled datasources. You'll be able to provide a db-spec (hash map) and a connection pooled datasource class name com.zaxxer.hikari.HikariDataSource
or com.mchange.v2.c3p0.ComboPooledDataSource
for example, and it will build the JDBC URL, create the datasource class, call .setJdbcUrl
on it, and set other parameters based on whatever else is in the hash map, using clojure.java.data/to-java
. My first thought is to put this new function in next.jdbc.connection
(because that's where all the db-spec -> URL logic is) but a) I don't know what to call it and b) I'm not sure if that's the best place for it. Thoughts?
Also, are there any other connection pool libraries that folks are commonly using?
I know of BoneCP (tried it once, had problems, haven't tried it since -- looks like the last release was six years ago now so maybe it's no longer maintained or used?).
@ghadi Yup, I mentioned both HikariCP and c3p0 above -- I have tests in next.jdbc
already for both of those.
Looking at Apache DBCP -- seems to be actively maintained but I don't hear it mentioned much? And it uses .setUrl
instead of .setJdbcUrl
... sigh
And it doesn’t publish releases to Maven 😞
The Tomcat DBCP seems to be the more widely used, updated version of Apache DBCP. At least it's published to Maven (and it also uses .setUrl
instead of .setJdbcUrl
)
I suspect Hikari and c3p0 are the two most widely used and they're easy to support so maybe that's all I'll bother with out of the box. Just read that the author of BoneCP considers it deprecated and refers everyone to HikariCP instead.
https://github.com/seancorfield/next-jdbc/blob/master/doc/getting-started.md#connection-pooling (for the changes on master that will be in 1.0.3 next week).