Fork me on GitHub
#sql
<
2019-07-18
>
seancorfield16:07:00

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?

kszabo17:07:35

next.jdbc.connection/->pool ?

4
seancorfield17:07:29

Also, are there any other connection pool libraries that folks are commonly using?

seancorfield17:07:22

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?).

seancorfield17:07:31

@ghadi Yup, I mentioned both HikariCP and c3p0 above -- I have tests in next.jdbc already for both of those.

seancorfield17:07:23

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

seancorfield17:07:35

And it doesn’t publish releases to Maven 😞

seancorfield17:07:34

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)

seancorfield17:07:09

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.

👍 4