Our application can embed/use [link javamelody|https://github.com/javamelody/javamelody/wiki] library, This enables us to gather some information about production context. About [link jdbc configuration|https://github.com/javamelody/javamelody/wiki/UserGuide#7-jdbc], everything works as expected when * no pool framework is used (or default one) * c3p0 pool is used But using [link HikariCP|https://brettwooldridge.github.io/HikariCP/], neither sql requests /nor jdbc calls are logged.
Having a look at the {{HikariConnectionProvider}} and {{HikariConfigurationUtil}} classes (we are using 4.2 branches), we successfully make it work.
Changes we applyied * method HibernateConfigurationUtil#loadConfiguration(Map props) * {code:java} // Do not move this line ! HikariConfig hikariConfig = new HikariConfig(hikariProps);
// if javamelody is used if(props.containsKey(DRIVER_ONLY)) { hikariConfig.addDataSourceProperty("driver", "."), props.get(DRIVER_ONLY)); } return hikariConfig; {code}
where *DRIVER_ONLY* == *hibernate.connection.driver*
I didn't look further why this property can not be set as the previous ones, but it only works tihs way right now.
Let me know if you need any information. Thanks, Nicolas |
|