Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-5683

BaseJDBCTestCase.getDatabaseProperty() should close resources before returning

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 10.9.1.0
    • 10.9.1.0
    • Test
    • None

    Description

      BaseJDBCTestCase.getDatabaseProperty() creates a PreparedStatement and a ResultSet that are not closed before the method returns. If a test case calls getDatabaseProperty() many times, the open statements may have a big memory footprint.

      This can be seen for example by running jdbcapi.AuthenticationTest with -Xmx64. It will fail with an OutOfMemoryError when testNoCollisionsWithConfigurableHash() runs in client/server mode.

      Attachments

        1. d5683-1a-close-and-forget.diff
          2 kB
          Knut Anders Hatlen

        Activity

          People

            knutanders Knut Anders Hatlen
            knutanders Knut Anders Hatlen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: