Hello Adnan,
About your problem:
As I can see from the stacktrace you added, maybe the next property will be more suitable:
main.datasource.hikari.connection-timeout
?
If not, it makes sense to check another timeout hikary properties.
Another thing to be checked: is this problem occur for the main datasource? In case of additional datasource its configuration will look like this:
<datasourceName>.datasource.hikari.*
If none of this helps I would recommend putting breakpoints inside com.zaxxer.hikari.HikariConfig#setConnectionTimeout
and com.zaxxer.hikari.HikariConfig#validateNumerics
to see why this 30000
ms is set to com.zaxxer.hikari.HikariConfig#connectionTimeout
.
After timeout will be increased:
If increasing timeout will not help to solve the problem, please check whether the connections hang somehow because of locks, too long operations, or pool depletion. That’s all I can guess without seeing a reproducible example.
If you still want to try another connection pool:
Please, take note that Jmix has not been fully tested with other connection pools and flawless work is not guaranteed with them.
But if you want to use another connection pool you can configure it like for any other spring boot application. Replace the next lines in your <ProjectName>Application.java
:
@Bean
@Primary
@ConfigurationProperties("main.datasource")
DataSourceProperties dataSourceProperties() {
return new DataSourceProperties();
}
@Bean
@Primary
@ConfigurationProperties("main.datasource.hikari")
DataSource dataSource(final DataSourceProperties dataSourceProperties) {
return dataSourceProperties.initializeDataSourceBuilder().build();
}
With this lines:
@Bean
@Primary
@ConfigurationProperties("main.datasource")
DataSourceProperties dataSourceProperties() {
DataSourceProperties dataSourceProperties = new DataSourceProperties();
dataSourceProperties.setType(<datasource_class>); // e.g. org.apache.commons.dbcp2.BasicDataSource.class
return dataSourceProperties;
}
@Bean
@Primary
@ConfigurationProperties("main.datasource.<suffix>") // e.g. main.datasource.dbcp2
DataSource dataSource(final DataSourceProperties dataSourceProperties) {
return dataSourceProperties.initializeDataSourceBuilder().build();
}
See this spring boot class to get datasource class names and config prefixes.
See also Spring boot documentation about supported connection pools
Regards,
Dmitry