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

retain NextException #719

Closed
nitincchauhan opened this issue Sep 14, 2016 · 2 comments
Closed

retain NextException #719

nitincchauhan opened this issue Sep 14, 2016 · 2 comments

Comments

@nitincchauhan
Copy link
Contributor

two changes:

  1. in getLastConnectionFailure() it should be just get() and not getAndSet(null)
  2. nullify it after successful isValid()

see http://stackoverflow.com/questions/39479345/how-do-i-know-if-my-hikaricp-pool-is-really-exhausted-when-sqltransientconnectio

@brettwooldridge
Copy link
Owner

@nitincchauhan Agreed on getAndSet(null), but resetting in isValid() is not correct. The current reset in newConnection() is sufficient.

@nitincchauhan
Copy link
Contributor Author

nitincchauhan commented Sep 14, 2016

please nullify after successful isConnectionAlive too, just like newConnection(). otherwise getConnection() may report 'stale' exception and it can not be used to distinguish as pool exhausted or db problem

once set in isConnectionAlive() for one bad connection, even if pool is exhausted, it would carry same exception till pool adds new connection.

Also, probably setting nextException is redundant and polluting logs because 'cause is set as nextException' anyway. printing exception also prints cause, as ...caused by...

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
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