graphql

erwinrooijakkers 2019-08-14T07:50:48.020600Z

Is this example from the Lacinia tutorial (https://lacinia.readthedocs.io/en/latest/tutorial/database-1.html)

(defn ^:private pooled-data-source
  [host dbname user password port]
  {:datasource
   (doto (ComboPooledDataSource.)
     (.setDriverClass "org.postgresql.Driver" )
     (.setJdbcUrl (str "jdbc:postgresql://" host ":" port "/" dbname))
     (.setUser user)
     (.setPassword password))})
production ready?

erwinrooijakkers 2019-08-14T08:22:13.020900Z

Using the c3po connection pool https://www.mchange.com/projects/c3p0/#using_combopooleddatasource

erwinrooijakkers 2019-08-14T08:22:53.021400Z

I noticed it only makes one connection with the database

erwinrooijakkers 2019-08-14T08:23:01.021700Z

When using Hikari I immediately see 10 connections

erwinrooijakkers 2019-08-14T08:23:08.022Z

But maybe c3po works different

erwinrooijakkers 2019-08-15T08:55:54.022800Z

Thanks

gklijs 2019-08-14T08:27:45.022100Z

Anything specific you have doubts about? Jdbc-next has support for a pooled data source baked in and is more future proof. But apart from that I don't see anything strange.

gklijs 2019-08-14T08:51:10.022300Z

You could try #sql jdbc.next supports both https://github.com/seancorfield/next-jdbc/blob/master/doc/getting-started.md#connection-pooling I don't know the differences, but did see the same behaviour using hikari.