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

Problems with 2 HikariCP instances in same JVM #136

Closed
WhiteTrashLord opened this issue Aug 21, 2014 · 3 comments
Closed

Problems with 2 HikariCP instances in same JVM #136

WhiteTrashLord opened this issue Aug 21, 2014 · 3 comments

Comments

@WhiteTrashLord
Copy link

HikariCP has been running very stable for several weeks. Thanks for that.

Recently I added another Database. So I connect to 1 local database and to 1 remote database.
After some days I got this error:

java.sql.SQLException: Timeout of 30000ms encountered waiting for connection.
at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:192)
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:91)

He always tried to connect but it never was successfully. It failed for the remote database but the database was online all the time and it was also reachable (I am quite sure of this).

I have used HikariCP-1.4.0.jar from Maven for this and I created 2 different HikariCP instances in 2 classes. I just made a fast test with latest source code version. In this case one HikariCP establieshed a connection to the wrong database.

I hope you can fix this problem soon.

@brettwooldridge
Copy link
Owner

Before I dig too much further, can you try with HikariCP 2.0.1?

@brettwooldridge
Copy link
Owner

HikariCP 2.0.1 definitely contains a fix for possible spurious timeouts under certain race conditions.

I am curious how you configured HikariCP in the case with two instances. HikariCP contains no static members (other than constants, etc.) so it is basically impossible for one pool to connect to the database specified by another pool.

@WhiteTrashLord
Copy link
Author

I am using HikariCP-java6-2.0.1 for some days now. There were no more problems. I will open a new issue in case something happens again :)

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