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

Resolving connection leak in VirDB implementation #7

Merged
merged 1 commit into from Sep 6, 2014

Conversation

Projects
None yet
2 participants
@aldaris
Contributor

aldaris commented Sep 6, 2014

The root cause of the connection leak was in the VirDB constructor:
after the connection was acquired, the constructor was attempting to
perform a query on the connection straight away, however under certain
circumstances, that could result in an exception preventing the object
construction. Since the object was never fully constructed, the
try-with-resources statement had no chance of actually calling the close
method to free up the acquired JDBC connection.
I've modified the initialization logic, so now the initial query is done
separately, also did some cleanup around the debug messages as they weren't
quite descriptive.

Resolving connection leak in VirDB implementation
The root cause of the connection leak was in the VirDB constructor:
after the connection was acquired, the constructor was attempting to
perform a query on the connection straight away, however under certain
circumstances, that could result in an exception preventing the object
construction. Since the object was never fully constructed, the
try-with-resources statement had no chance of actually calling the close
method to free up the acquired JDBC connection.
I've modified the initialization logic, so now the initial query is done
separately, also did some cleanup around the debug messages as they weren't
quite descriptive.

tmichel added a commit that referenced this pull request Sep 6, 2014

Merge pull request #7 from aldaris/master
Resolving connection leak in VirDB implementation

@tmichel tmichel merged commit 69176b3 into kir-dev:master Sep 6, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment