metamodel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (METAMODEL-1093) JDBC CompiledQuery ResultSets not closed properly
Date Fri, 03 Jun 2016 10:09:59 GMT


ASF GitHub Bot commented on METAMODEL-1093:

GitHub user LosD opened a pull request:

    METAMODEL-1093 close compiled ResultSets

    This makes sure that ResultSets are closed JdbcDataSet itselfs closes. Also refactors
closing of Statements and ResultsSets to use try-with-resources as much as possible. This
also moves the responsibility of closing Statements and ResultSets away from JdbcDataContext,
which seems to belong more to the caller, since the context isn't the one to actually track
them even though it creates them (and it is of course a requirement for using try-with-resources).
    Fixes METAMODEL-1093

You can merge this pull request into a Git repository by running:

    $ git pull mm-close-dataset

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #107
commit 7ccb446a846acd856abfee8526d19d4d05b77785
Author: Dennis Du Krøger <>
Date:   2016-05-12T09:35:18Z

    Do already-loaded check before retrieving connection.
    Fixes METAMODEL-252

commit 2c751ab452e4e327790bb8565ff7acc3fa1d563a
Author: Dennis Du Krøger <>
Date:   2016-05-23T12:33:47Z

    Merge remote-tracking branch 'origin/master'

commit 456815b76bb69f88afd27d83c9794bcb8da76cad
Author: Dennis Du Krøger <>
Date:   2016-06-02T07:47:24Z

    Merge remote-tracking branch 'origin/master'

commit 89dd268cee63410373f893e2f38a02059bab876b
Author: Dennis Du Krøger <>
Date:   2016-06-02T13:47:25Z

    Better control of closing resources.


> JDBC CompiledQuery ResultSets not closed properly
> -------------------------------------------------
>                 Key: METAMODEL-1093
>                 URL:
>             Project: Apache MetaModel
>          Issue Type: Bug
>            Reporter: Dennis Du Krøger
>            Assignee: Dennis Du Krøger
> When running compiled queries, the JdbcResultSet only returns the lease on the query,
it doesn't close the result set.
> For most JDBC drivers, that isn't really an issue, as they can easily handle connections
with multiple open result sets. However, the MySQL JDBC sometimes uses streaming result sets
(to save memory), of which only one can be open at a time.
> I almost have a PR ready, but I'm having a hard time making any kind of test that makes
sense: When I make a simple test, the driver seems to close the resultset automatically right
after execution, but that is not what we see in DataCleaner, and I'm not really sure why.
> I think I'll post it anyway, as it is rather large (I also tried to avoid repeats by
making sure that the JdbcDataContext only handles the connection, and the rest is handled
by try-with-resources as far as possible), so an early review would be nice.

This message was sent by Atlassian JIRA

View raw message