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

With AutoCommit to false, connection are not closed #85

Open
hanouard opened this issue Apr 9, 2018 · 3 comments
Open

With AutoCommit to false, connection are not closed #85

hanouard opened this issue Apr 9, 2018 · 3 comments

Comments

@hanouard
Copy link

hanouard commented Apr 9, 2018

The connections are not being closed when the autoCommit is set to false.

Is there a reason why we have this call Util.closeQuietlyIfAutoCommit(state.con); in a QuerySelectOnSubscribe ?

private static void closeQuietly(State state) {
        // ensure only closed once and avoid race conditions
        if (state.closed.compareAndSet(false, true)) {
            // set the state fields to null after closing for garbage
            // collection purposes
            log.debug("closing rs");
            Util.closeQuietly(state.rs);
            log.debug("closing ps");
            Util.closeQuietly(state.ps);
            log.debug("closing con");
            Util.closeQuietlyIfAutoCommit(state.con);
            log.debug("closed");
        }
    }

the problem with this config, is im getting a lot of active connections in my pool, and i end up with Connection is not available, request timed out after 30001ms.

And may i suggest to log the result of the operations too in debug.

@davidmoten
Copy link
Owner

A unit test would be great, preferrably using Database.test() as per README.md. Can you supply one?

@davidmoten
Copy link
Owner

Ah oops, this is for RxJava 1.x, forget the bit about Database.test(), but a unit test would still be great, or sample code.

@hanouard
Copy link
Author

i could provide you with a sample project.

connection-not-closing.zip

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