-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Comments
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? |
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. |
…empts to connect to the database. See issue 770: brettwooldridge#770
…recating initializationFailFast.
…recating initializationFailFast.
…ection(), and added unit test.
…Timeout and deprecating initializationFailFast. Exception path still needs some work… coming in the next commit.
…Timeout and deprecating initializationFailFast.
…Timeout and deprecating initializationFailFast.
…ce.getConnection() and improved JavaDoc.
…ng in HikariDataSource.getConnection(), and added unit test.
…Timeout and deprecating initializationFailFast. Exception path still needs some work… coming in the next commit.
…Timeout and deprecating initializationFailFast.
…Timeout and deprecating initializationFailFast.
…ce.getConnection() and improved JavaDoc.
…ng in HikariDataSource.getConnection(), and added unit test.
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?)
The text was updated successfully, but these errors were encountered: