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

Properties in configuration files: use dataSource prefix ? #2182

Open
NathanEckert opened this issue Mar 1, 2024 · 0 comments
Open

Properties in configuration files: use dataSource prefix ? #2182

NathanEckert opened this issue Mar 1, 2024 · 0 comments

Comments

@NathanEckert
Copy link

Hello,

On the example property file provided in https://github.com/brettwooldridge/HikariCP?tab=readme-ov-file#rocket-initialization

Most of the properties are prefixed with dataSource.. However, upon playing with the configuration, I noticed it is not true for all, for example:

  @Test
  void testHikariConfigFileWithDataSourcePrefix() {
    System.setProperty("hikaricp.configurationFile", "src/test/resources/hikari_with_prefix.properties");

    var config = new HikariConfig();

    config.setJdbcUrl(RedshiftTestConstants.REDSHIFT_JDBC_URL + RedshiftTestConstants.TEST_DATABASE_NAME);
    config.setUsername(System.getenv("REDSHIFT_USERNAME"));
    config.setPassword(System.getenv("REDSHIFT_PASSWORD"));

    @Cleanup
    var dataSource = new HikariDataSource(config);

    SoftAssertions softly = new SoftAssertions();
    softly.assertThat(dataSource.getConnectionTimeout()).isEqualTo(250);
    softly.assertThat(config.getConnectionTimeout()).isEqualTo(250);
    softly.assertAll();

  }

Associated with the file:

dataSource.connectionTimeout=250

If I change the file to

connectionTimeout=250

it works.

I was wondering where i could get the list of the actual names to use (mentioning also if it has a prefix). If this list exist, I could quickly update the README

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant