-
-
Notifications
You must be signed in to change notification settings - Fork 608
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 poolName not read from config #1326
Comments
This is actually a rather serious and annoying issue for play-slick users which manages Slick configuration itself so if Example play-slick configuration based on the Play framework documentation:
And relevant parts of the HikariCP debug log:
|
I think the commit 4569c52 didn't take into consideration that JMX and logging actually relies on configurable pool names. I found no workaround for this issue because the pool is created and MBeans are registered in the pool constructor the same time the datasource is created and HikariCP provides no way to access the pool instance and register MBeans manually after the datasource is created. So having manually configurable pool names is a requirement for JMX monitoring. |
In
HikariCPJdbcDataSource.forConfig
, the pool name is not read from the config value (poolName
, as documented on the HikariCP wiki), but instead picked up from thename
argument (see https://github.com/slick/slick/blob/master/slick-hikaricp/src/main/scala/slick/jdbc/hikaricp/HikariCPJdbcDataSource.scala#L47).Furthermore, the
name
argument is actually thepath
argument of theJdbcBackend.forConfig
call (see https://github.com/slick/slick/blob/master/slick/src/main/scala/slick/jdbc/JdbcBackend.scala#L268), which is confusing since you get an empty pool name if you use a top-level config.Is there any reasoning why the pool name is set like this and not simply picked up from the config?
The text was updated successfully, but these errors were encountered: