Data sources without explicitly specified dataSource or dataSourceClass overwrite each others connectionTimeouts
Author: Tobias43Created Jun 18, 2026Updated Jun 18, 2026
Steps to reproduce:
- Create a HikariDataSource A with
HikariConfigurationcontaining ajdbcUrland adriverClassName(but neitherdataSourceClassName,dataSourceJndiNamenordataSource) and aconnectionTimeoutof 10s. - Create a HikariDataSource B with a different
jdbcUrland a timeout of 20s.
Actual result:
Both data sources use a connection timeout of 20s (the last one wins) because Hikari uses the static method java.sql.DriverManager#setLoginTimeout
Expected result: Both data sources use their own individual connection timeouts.
This probably means having to use some vendor specific properties, but I think it is preferable to the current behavior. Even ignoring the connectionTimeout when no data source is set explicitly would be better than data sources overwriting each others timeouts.
Source: brettwooldridge/HikariCP