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

Support multiple connections at startup #770

Closed
kny78 opened this issue Nov 25, 2016 · 2 comments
Closed

Support multiple connections at startup #770

kny78 opened this issue Nov 25, 2016 · 2 comments

Comments

@kny78
Copy link

kny78 commented Nov 25, 2016

USE CASE
When we start our environment, we often start the database server on a different machine, than the application server. And then it is practically impossible to ensure that the application starts after the database.

The property initializationFailFast will not help us, as it will return with a connection-pool that does not work. If for example Ebean og Hibernate starts afterwards, they will fail as they can not fetch a Connection.

PROPOSED SOLUTION
We set a parameter:
initializationMaxAttempts

Which should default to 1 (todays functionality).
This should say how many attempts HikariCP should perform to get the initial connections.
If connection is not retrieved, then it should log clearly that connection is not coming up. (ERROR?)

@billoneil
Copy link

I feel like this can be easily handled in application logic and should not be introduced into HikariCP itself. Can't you just wrap your initialization logic with the retries?

@kny78
Copy link
Author

kny78 commented Nov 25, 2016

It would be easy to add it to one application, but we have approx 100 applications, and we really would like to control this in the connection pool, where this logic should be.

I will create a pull request, and you can consider if it is right for HikariCP, and if the code is ok.

kny78 pushed a commit to kny78/HikariCP that referenced this issue Nov 25, 2016
brettwooldridge added a commit that referenced this issue Nov 29, 2016
brettwooldridge added a commit that referenced this issue Dec 18, 2016
brettwooldridge added a commit that referenced this issue Dec 21, 2016
brettwooldridge added a commit that referenced this issue Dec 21, 2016
kollstrom pushed a commit to kollstrom/HikariCP that referenced this issue Feb 4, 2021
…Timeout and deprecating

initializationFailFast.  Exception path still needs some work… coming in the
next commit.
kollstrom pushed a commit to kollstrom/HikariCP that referenced this issue Feb 4, 2021
…Timeout and deprecating

initializationFailFast.
kollstrom pushed a commit to kollstrom/HikariCP that referenced this issue Feb 4, 2021
…Timeout and deprecating

initializationFailFast.
kollstrom pushed a commit to kollstrom/HikariCP that referenced this issue Feb 4, 2021
kollstrom pushed a commit to kollstrom/HikariCP that referenced this issue Feb 4, 2021
…ng in HikariDataSource.getConnection(),

and added unit test.
kollstrom pushed a commit to kollstrom/HikariCP that referenced this issue Feb 4, 2021
…Timeout and deprecating

initializationFailFast.  Exception path still needs some work… coming in the
next commit.
kollstrom pushed a commit to kollstrom/HikariCP that referenced this issue Feb 4, 2021
…Timeout and deprecating

initializationFailFast.
kollstrom pushed a commit to kollstrom/HikariCP that referenced this issue Feb 4, 2021
…Timeout and deprecating

initializationFailFast.
kollstrom pushed a commit to kollstrom/HikariCP that referenced this issue Feb 4, 2021
kollstrom pushed a commit to kollstrom/HikariCP that referenced this issue Feb 4, 2021
…ng in HikariDataSource.getConnection(),

and added unit test.
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

2 participants