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

HikariCP: config property for init connection sql added #1293

Merged
merged 2 commits into from
Feb 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions documentation/manual/configuration.textile
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,12 @@ c3p0 is very asynchronous. Slow JDBC operations are generally performed by helpe
Default: @3@


h3(#db.pool.connectionInitSql). db.pool.connectionInitSql

Sets the SQL string that will be executed on all new connections when they are created, before they are added to the pool (HikariCP only).

Default: none

h2(#evolutions). Database evolutions


Expand Down
4 changes: 4 additions & 0 deletions framework/src/play/db/hikaricp/HikariDataSourceFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public DataSource createDataSource(Configuration dbConfig) throws PropertyVetoEx
ds.setLoginTimeout(parseInt(dbConfig.getProperty("db.pool.loginTimeout", "0"))); // in seconds
ds.setMaxLifetime(parseLong(dbConfig.getProperty("db.pool.maxConnectionAge", "0"))); // in ms

if (dbConfig.getProperty("db.pool.connectionInitSql") != null) {
ds.setConnectionInitSql(dbConfig.getProperty("db.pool.connectionInitSql"));
}

// not used in HikariCP:
// db.pool.initialSize
// db.pool.idleConnectionTestPeriod
Expand Down