Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-90

ResultSet not closed on new execution of Statement

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.7
    • Fix Version/s: 1.1.8
    • Component/s: None
    • Labels:
      None

      Description

      I noticed with Hibernate I sometimes get java.sql.SQLException: There is an open result set on the current connection, which must be closed prior to executing a query when retrieving a result, depending on the complexity of the entity I am loading. Apparently Hibernate is relying on the specified behavior of the Statement to implicitly close any open ResultSet when performing a new execution.

      From JDBC Spec - 15.2.5 Closing a ResultSet Object

      ...
      A ResultSet object is implicitly closed when

      • The associated Statement object is re-executed
        …

      I worked around this in a local branch with the following code:

      org.mariadb.jdbc.MySQLStatement

      protected boolean execute(Query query) throws SQLException {
          synchronized (protocol) {
              if (protocol.activeResult != null) {
                  protocol.activeResult.close();
              }
              // snip
          }
      }

        Attachments

          Activity

            People

            Assignee:
            massimo.siani Massimo Siani (Inactive)
            Reporter:
            emattheis Erik Mattheis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.