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

Connection leak in MySQL/PostgreSQL proxy managers #246

Closed
rnby-mike opened this issue Mar 27, 2022 · 2 comments
Closed

Connection leak in MySQL/PostgreSQL proxy managers #246

rnby-mike opened this issue Mar 27, 2022 · 2 comments

Comments

@rnby-mike
Copy link

rnby-mike commented Mar 27, 2022

Inside removeProxy(Long key) method connection is acquired by datasource.getConnection() but never closed

The fix may look like this

public void removeProxy(Long key) {
    try (Connection connection = dataSource.getConnection();
         PreparedStatement removeStatement = connection.prepareStatement(removeSqlQuery)) {
        removeStatement.setLong(1, key);
        removeStatement.executeUpdate();
    } catch (SQLException e) {
        throw new BucketExceptions.BucketExecutionException(e);
    }
}
@vladimir-bukhtoyarov
Copy link
Collaborator

@rnby-mike

Thank you, fix will be released soon.

@vladimir-bukhtoyarov
Copy link
Collaborator

Released with version 7.4.0

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