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

lastConnectionFailure causes null pointer #63

Closed
CorayThan opened this issue Apr 23, 2014 · 2 comments
Closed

lastConnectionFailure causes null pointer #63

CorayThan opened this issue Apr 23, 2014 · 2 comments
Labels

Comments

@CorayThan
Copy link

I'm trying to configure Hikari, but I'm getting a null pointer right now. HikariPool line 175:

        throw new SQLException(String.format("Timeout of %dms encountered waiting for connection.", configuration.getConnectionTimeout()), lastConnectionFailure.getAndSet(null));

lastConnectionFailure is null. Perhaps a null check is warranted?

@brettwooldridge
Copy link
Owner

The bug is on line 257. lastConnectionFailure should never be null. Line 257 should be lastConnectionFailure.set(null) not lastConnectionFailure = null. I will push 1.3.7 today to fix it.

@CorayThan
Copy link
Author

Awesome! I'll check and make sure I get the correct error now.

brettwooldridge added a commit that referenced this issue Apr 28, 2014
* master:
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release HikariCP-1.3.7
  Remove redundant assignment.
  Eliminate double-execution of shutdown code.
  Updated change log
  Updated change log
  Fix typo bug in JNDI factory class ... reflect properties from HikariConfig instead of HikariPool.
  Add a test for PropertyBeanSetter.getPropertyNames().
  Add a JNDI factory to create datasources for Tomcat users.
  This fixes #65 as well as correcting OSGi manifest generation warnings by reorganizing the code and packages somewhat to ensure that the publicly exported com.zaxxer.hikari package does not expose any internal classes.
  Fix isConnectionAlive() check when using Connection.isValid().  Clarify logging.
  Fix issue #63 improper setting of null state during connection failure.
  [maven-release-plugin] prepare for next development iteration
  Update TODO.md
  Update maven version.
  Update README.md

Conflicts:
	README.md
	pom.xml
brettwooldridge added a commit that referenced this issue Apr 28, 2014
* master:
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release HikariCP-1.3.7
  Remove redundant assignment.
  Eliminate double-execution of shutdown code.
  Updated change log
  Updated change log
  Fix typo bug in JNDI factory class ... reflect properties from HikariConfig instead of HikariPool.
  Add a test for PropertyBeanSetter.getPropertyNames().
  Add a JNDI factory to create datasources for Tomcat users.
  This fixes #65 as well as correcting OSGi manifest generation warnings by reorganizing the code and packages somewhat to ensure that the publicly exported com.zaxxer.hikari package does not expose any internal classes.
  Fix isConnectionAlive() check when using Connection.isValid().  Clarify logging.
  Fix issue #63 improper setting of null state during connection failure.
  [maven-release-plugin] prepare for next development iteration
  Update TODO.md
  Update maven version.
  Update README.md

Conflicts:
	README.md
	pom.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants