Comments (11)
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.
from play-hikaricp.edulify.com.
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.
from play-hikaricp.edulify.com.
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?
from play-hikaricp.edulify.com.
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}
from play-hikaricp.edulify.com.
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:
from play-hikaricp.edulify.com.
Anyway, I will leave this issue open because we need to correct the docs.
from play-hikaricp.edulify.com.
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.
from play-hikaricp.edulify.com.
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?
from play-hikaricp.edulify.com.
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.
from play-hikaricp.edulify.com.
+1
@megazord direct typesafe config (HOCON) support sounds like exactly what I'm suggesting in issue #36
from play-hikaricp.edulify.com.
Master branch already has dropped the translation from bonecp to hikaricp.
from play-hikaricp.edulify.com.
Related Issues (20)
- It seems that 2.0.0-M1 cannot be resolved from the repository HOT 2
- Correct error report when database connection fail
- Review documentation
- Can't download the package HOT 2
- I need to disable 'initializationFailFast' on version 1.5.x HOT 1
- Version 2.0.2 with JAVA 7 HOT 2
- allow play to start when a configured db is unavailable HOT 7
- add sensible pool names by default HOT 1
- new release? HOT 3
- why use play.utils.ProxyDriver HOT 1
- com/zaxxer/hikari/HikariConfig : Unsupported major.minor version 52.0 with Java 7 HOT 4
- Config translation for JDBC connection settings HOT 5
- Play 2.2.2 with play hikari plugin 1.0.0 not working HOT 8
- Support of latest HikariCP with play 2.2.x HOT 1
- Cannot use logSql with JNDI HOT 1
- Support for custom JDBC Connection properties HOT 1
- Hikaricp metricRegistry definition HOT 2
- Duplicate Pools - Resolved By Removing Plugin Config Line
- [Play framwork] Cannot loading Configuration from application.conf
- is the newest version can use in play 2.2.6? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from play-hikaricp.edulify.com.