Derby
  1. Derby
  2. DERBY-2149

Replace Vectors and Hashtables with ArrayLists and HashMaps in RAMTransaction

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.3.1.4
    • Fix Version/s: 10.3.1.4
    • Component/s: Store
    • Labels:
      None
    • Bug behavior facts:
      Performance

      Description

      In org.apache.derby.impl.store.access.RAMTransaction, synchronized collection objects could be replaced with unsynchronized ones. See discussion here: http://www.nabble.com/Use-of-synchronized-containers-in-engine-code-tf2754469.html

      1. derby-2149-1a.diff
        12 kB
        Knut Anders Hatlen
      2. derby-2149-1b.diff
        12 kB
        Knut Anders Hatlen

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        The attached patch replaces four Vectors and one Hashtable in RAMTransaction with ArrayLists and a HashMap. According to the discussion on derby-dev, it is safe to assume single-threaded access in RAMTransaction. Please let me know if there are cases where this assumption is incorrect. Derbyall and the JUnit tests ran cleanly with the patch applied.

        Show
        Knut Anders Hatlen added a comment - The attached patch replaces four Vectors and one Hashtable in RAMTransaction with ArrayLists and a HashMap. According to the discussion on derby-dev, it is safe to assume single-threaded access in RAMTransaction. Please let me know if there are cases where this assumption is incorrect. Derbyall and the JUnit tests ran cleanly with the patch applied.
        Hide
        Knut Anders Hatlen added a comment -

        I reran the JUnit tests and got two failures in the nist suite. They seem related to the patch, so I'm removing the patch available flag for now. Will investigate the failures later.

        Show
        Knut Anders Hatlen added a comment - I reran the JUnit tests and got two failures in the nist suite. They seem related to the patch, so I'm removing the patch available flag for now. Will investigate the failures later.
        Hide
        Knut Anders Hatlen added a comment -

        Uploading a new patch. The problem with the previous one was a mix-up of two variable names. Have run derbyall and the JUnit tests with one failure in store/readlocks.sql (diff similar to http://www.multinet.no/~solberg/public/Apache/Derby/testlog/Linux-2.4.21-27.ELsmp_i686-i686/240441-storeall_diff.txt).

        Show
        Knut Anders Hatlen added a comment - Uploading a new patch. The problem with the previous one was a mix-up of two variable names. Have run derbyall and the JUnit tests with one failure in store/readlocks.sql (diff similar to http://www.multinet.no/~solberg/public/Apache/Derby/testlog/Linux-2.4.21-27.ELsmp_i686-i686/240441-storeall_diff.txt ).
        Hide
        Knut Anders Hatlen added a comment -

        Committed revision 491769.

        Show
        Knut Anders Hatlen added a comment - Committed revision 491769.

          People

          • Assignee:
            Knut Anders Hatlen
            Reporter:
            Knut Anders Hatlen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development