Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to set driver properties when using a connection pool #186

Closed
holyjak opened this issue Oct 13, 2021 · 3 comments
Closed

Document how to set driver properties when using a connection pool #186

holyjak opened this issue Oct 13, 2021 · 3 comments
Assignees

Comments

@holyjak
Copy link
Contributor

holyjak commented Oct 13, 2021

For next-jdbc and jdbc.connection/->pool , it seems that neither the docstring nor the docs mention how to set properties on the underlying Jdbc driver, right? That is understandable since it will differ for each pool but still an example in the docs would be nice. I currently do this for Hikari:

(jdbc.connection/->pool com.zaxxer.hikari.HikariConfig
                            {:dbtype "postgres" :host "localhost", :port 5432, :username "ardoq", :password "ardoq"
                             :dataSourceProperties
                             (doto (java.util.Properties.)
                               (.putAll {"socketTimeout" "30"}))})

Not sure whether there is a nicer way... (java.data cannot convert a map to Properties, yet)

@seancorfield
Copy link
Owner

I had a look over the c3p0 docs and there doesn't appear to be an equivalent to this -- everything is just a configuration item for c3p0 itself and it does whatever is appropriate, as far as I can tell (and its source code is pretty impenetrable since a bunch of it is auto-generated from XML templates -- eek!).

I'll probably add the Properties stuff to java.data first and then just document how to use that in the HikariCP-specific docs in next.jdbc (and cut new releases).

It'll be a while before I get my next decent OSS window.

@seancorfield seancorfield self-assigned this Oct 13, 2021
@seancorfield
Copy link
Owner

In 1.2.737

@seancorfield
Copy link
Owner

Note: this does not actually work -- it needs to be com.zaxxer.hikari.HikariDataSource (instead of HikariConfig). Someone just tripped over this in the docs so I'm fixing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants