Uploaded image for project: 'Commons DBCP'
  1. Commons DBCP
  2. DBCP-352

Repeated calls to getMetadata in a transaction leads to performance degredation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.2.2, 1.3.1, 1.4
    • 1.3.1, 1.4.1
    • None
    • PostgreSQL, MySQL, JDK 1.6

    Description

      During long-running transactions that utilize conditional logic based on the database metadata, it is possible to get thousands of calls to Connection.getMetaData. An ArrayList is built up containing objects which are never removed (this is the cause of DBCP-330). However, the array is shared with all other PreparedStatements, so the array scan and modification time keeps rising as the transaction progresses.

      I will attempt to attach an Eclipse project; profiling (or even a few JStacks) will show that most of the time is spent scanning the cluttered and growing array for objects to remove.

      Attachments

        1. commons-dbcp-1.4-patched.diff
          0.6 kB
          Derek Hulley
        2. DBCPMetadataTest.zip
          391 kB
          Derek Hulley

        Issue Links

          Activity

            People

              Unassigned Unassigned
              derekhulley Derek Hulley
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: