Skip to content

Close db resource#24

Merged
apcarp merged 2 commits intomainfrom
close-db-resource
Nov 28, 2023
Merged

Close db resource#24
apcarp merged 2 commits intomainfrom
close-db-resource

Conversation

@apcarp
Copy link
Contributor

@apcarp apcarp commented Nov 28, 2023

Fixes #23

@Override
public void close() throws IOException {
try {
con.close(); // TODO: Make sure closing connection also closes stmt and rs (pooled wrappers I'm looking at you)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad we finally got around to this TODO! A quick google reveals PooledConnections are indeed the exception and do not always clean up like you'd hope/expect (might be implementation dependent). Non-pooled connections do automatically clean up.

@apcarp apcarp merged commit 5617dae into main Nov 28, 2023
@apcarp apcarp deleted the close-db-resource branch November 28, 2023 17:43
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

Successfully merging this pull request may close these issues.

Streams Do Not Close All Database Resources

2 participants