Config options for play-hikaricp

1,379 views
Skip to first unread message

Brent Gracey

unread,
Mar 31, 2015, 9:31:46 AM3/31/15
to play-fr...@googlegroups.com
Hi all;

I'm trying to set the readOnly property for https://github.com/brettwooldridge/HikariCP which I'm using via http://edulify.github.io/play-hikaricp.edulify.com/

Does the play plugin only expose a sub-set of the config options? As the below doesn't seem to work



db.default.driver=com.mysql.jdbc.Driver
db.default.url="jdbc:mysql://localhost/orchestationLayerDB?useUnicode=true&characterEncoding=UTF-8"
db.default.user=root
db.default.password=""
db.default.readOnly=true



I'm seeing the below logs on startup

Properties: jdbcUrl=jdbc:mysql://localhost/orchestationLayerDB?useUnicode=true&characterEncoding=UTF-8, registerMbeans=false, driverClassName=com.mysql.jdbc.Driver, jdbc4ConnectionTest=true, maxLifetime=1800000, autoCommit=true, leakDetectionThreshold=0, username=root, maximumPoolSize=30, idleTimeout=600000, minimumIdle=5, readOnly=false, connectionTimeout=30000, password=

Or am i doing something incorrect?

Thanks,
Brent

Megazord

unread,
Mar 31, 2015, 9:44:33 AM3/31/15
to play-fr...@googlegroups.com
Brent,

Which version of the plugin are you trying? Also, could you please add the following line to your .conf:

logger.com.zaxxer.hikari.HikariConfig=DEBUG

Just so we can see exactly how your data source is being configured.

Best,

Brent Gracey

unread,
Mar 31, 2015, 11:52:48 AM3/31/15
to play-fr...@googlegroups.com
Hi,

In my sbt i have: "com.edulify" %% "play-hikaricp" % "1.5.0"


And with the extra logging I'm getting


[info] application - Creating Pool for datasource '
default'
[info] application - Loading Hikari configuration from Play configuration.
[info] application - Properties: jdbcUrl=jdbc:mysql://localhost/orchestationLayerDB?useUnicode=true&characterEncoding=UTF-8, registerMbeans=false, driverClassName=com.mysql.jdbc.Driver, jdbc4ConnectionTest=true, maxLifetime=1800000, autoCommit=true, leakDetectionThreshold=0, username=root, maximumPoolSize=30, idleTimeout=600000, minimumIdle=5, readOnly=false, connectionTimeout=5000, password=
[warn] c.z.h.HikariConfig - The jdbcConnectionTest property is now deprecated, see the documentation for connectionTestQuery
[info] application - Registering driver com.mysql.jdbc.Driver
[debug] c.z.h.HikariConfig - HikariCP pool HikariPool-13 configuration:
[debug] c.z.h.HikariConfig - autoCommit......................true
[debug] c.z.h.HikariConfig - catalog.........................
[debug] c.z.h.HikariConfig - connectionCustomizer............com.zaxxer.hikari.HikariConfig$1@679ea032
[debug] c.z.h.HikariConfig - connectionCustomizerClassName...
[debug] c.z.h.HikariConfig - connectionInitSql...............
[debug] c.z.h.HikariConfig - connectionTestQuery.............
[debug] c.z.h.HikariConfig - connectionTimeout...............5000
[debug] c.z.h.HikariConfig - dataSource......................
[debug] c.z.h.HikariConfig - dataSourceClassName.............
[debug] c.z.h.HikariConfig - dataSourceJNDI..................
[debug] c.z.h.HikariConfig - dataSourceProperties............{password=<masked>}
[debug] c.z.h.HikariConfig - driverClassName.................
[debug] c.z.h.HikariConfig - idleTimeout.....................600000
[debug] c.z.h.HikariConfig - initializationFailFast..........true
[debug] c.z.h.HikariConfig - isolateInternalQueries..........false
[debug] c.z.h.HikariConfig - jdbc4ConnectionTest.............false
[debug] c.z.h.HikariConfig - jdbcUrl.........................jdbc:mysql://localhost/orchestationLayerDB?useUnicode=true&characterEncoding=UTF-8
[debug] c.z.h.HikariConfig - leakDetectionThreshold..........0
[debug] c.z.h.HikariConfig - maxLifetime.....................1800000
[debug] c.z.h.HikariConfig - maximumPoolSize.................30
[debug] c.z.h.HikariConfig - metricRegistry..................
[debug] c.z.h.HikariConfig - minimumIdle.....................5
[debug] c.z.h.HikariConfig - password........................<masked>
[debug] c.z.h.HikariConfig - poolName........................HikariPool-13
[debug] c.z.h.HikariConfig - readOnly........................false
[debug] c.z.h.HikariConfig - registerMbeans..................false
[debug] c.z.h.HikariConfig - threadFactory...................
[debug] c.z.h.HikariConfig - transactionIsolation............
[debug] c.z.h.HikariConfig - username........................root

Brett Wooldridge

unread,
Apr 1, 2015, 10:02:39 AM4/1/15
to play-fr...@googlegroups.com
From my reading of their doc, it appears the property should be:

db.default.defaultReadOnly=true

-Brett

Megazord

unread,
Apr 1, 2015, 1:08:36 PM4/1/15
to play-fr...@googlegroups.com
Brent,

The proper documentation for version 1.5.0 is here:

https://github.com/edulify/play-hikaricp.edulify.com/tree/1.5.0

HTH

Brent Gracey

unread,
Apr 2, 2015, 6:43:55 AM4/2/15
to play-fr...@googlegroups.com
Great thanks

Adding 

db.default.hikaricp.file= filename


and then controlling the HikariCP configuration from there is allowing me to set the readOnly property


Joshua Newman

unread,
Aug 11, 2015, 7:30:49 PM8/11/15
to play-framework
This is an older thread, but I wanted to note that on 2.4.x I was able to set this property by adding:

db.default.hikaricp.readOnly = true

-Josh
Reply all
Reply to author
Forward
0 new messages