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

Play way is not correct #3

Closed
rvangsgaard opened this issue May 5, 2014 · 11 comments
Closed

Play way is not correct #3

rvangsgaard opened this issue May 5, 2014 · 11 comments

Comments

@rvangsgaard
Copy link

In HikariCPConfig the maxPoolSize is incorrect. Should it not be the following in line 82:

val maxConnectionsPerPartition = config.getInt("maxPoolSize").get

The same goes for the minPoolSize in line 88.

@rvangsgaard
Copy link
Author

Hmmm, it may the documentation that should be more accurate. I eventually found the required settings in HikariCPConfig

I cannot switch to Hikari proeprty file as, as I am using some features of TypesafeConfig in my db url.

@megazord
Copy link
Contributor

megazord commented May 5, 2014

Yes, the docs are wrong. I will probably close this issue after #4, since I will need to remap BoneCP properties to HikariCP avoiding deprecated properties.

@megazord
Copy link
Contributor

megazord commented May 5, 2014

By the way, about this:

I cannot switch to Hikari proeprty file as, as I am using some features of TypesafeConfig in my db url.

Could you please elaborate about which features are you using that prevents you to use a properties file? Is this change enough to enables you to migrate to a properties file?

@rvangsgaard
Copy link
Author

I do something like this, the mysql.url-params are the culprit here:

mysql.url-params="cachePrepStmts=true&prepStmtCacheSize=250&prepStmtCacheSqlLimit=2048"
db.default.driver=com.mysql.jdbc.Driver
db.default.url="jdbc:mysql://"${DATABASE_HOST}/${DATABASE_SCHEMA}?${mysql.url-params}

@megazord
Copy link
Contributor

megazord commented May 6, 2014

Hum, that is already supported in the current release (1.2.0), you can both reference another property (using ${some.property.name}) and environment variables (using ${env:SOME_ENV_VAR}).

Here is what is supported by commons configuration, which is used to read the hikaricp.properties file:

http://commons.apache.org/proper/commons-configuration/userguide/howto_basicfeatures.html#Variable_Interpolation

@megazord
Copy link
Contributor

megazord commented May 6, 2014

Anyway, I will leave this issue open because we need to correct the docs.

@rvangsgaard
Copy link
Author

Ah yes, my example was not precise enough. I have mysql.url-params defined in application.conf (Typesafe Config), and are referencing it in all the other config files - but commons configuration will not read references from the "parent" configuration.

I am trying to achieve that I only have to specify these parameters once, at reference it from all other mysql configurations.

@rvangsgaard
Copy link
Author

Support for embedded Typesafe Config would be great. Then something like this:

val subConfig = getConfig("db.default")
val Seq[(String, String)] = subConfig.map(_.keys.map{key => (key, subConfig.getString(key))}
// convert to java.util.Properties - send it to HikariCPConfig

What do you think?

@megazord
Copy link
Contributor

Sounds good. Maybe we could ditch the translation of bonecp->hikaricp in favor of this option. Also, since Typesafe Config supports environment variables, we could use it instead of commons configuration.

@dkharrat
Copy link

+1

@megazord direct typesafe config (HOCON) support sounds like exactly what I'm suggesting in issue #36

@megazord
Copy link
Contributor

Master branch already has dropped the translation from bonecp to hikaricp.

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

3 participants