Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7751

CallableStatement leak in Sql.call() method

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.5
    • Fix Version/s: 2.4.7
    • Component/s: SQL processing
    • Labels:
      None

      Description

      All Sql.call(...) methods ultimately delegate to Sql.callWithRows(...) method where we have:

      try {
          statement = connection.prepareCall(sql);
          // ...
      } finally {
          // ...
          closeResources(connection, statement);
      }
      

      The problem is that statement is unconditionally parsed and compiled each time, but the closeResources() method only closes it when statement caching is disabled. So with statement caching enabled we end up allocating and leaking a new CallableStatement instance per Sql.call() invocation.

        Attachments

          Activity

            People

            • Assignee:
              jwagenleitner John Wagenleitner
              Reporter:
              avladykin Alexey Vladykin
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: