• Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1M3
    • Fix Version/s: 3.1B1
    • Component/s: Core Library
    • Labels:


      Until we decide on unifying object and query caches, it would be cool if we could remove the shared lock from DataRowStore that causes issues like CAY-1124, and generally creates contention on access from multiple threads.

      We would need some kind of cross-over between LinkedHashMap (that allows to set up LRU policies among other things) and ConcurrentHashMap. There are a few solutions out there that may provide needed characteristics:

      1. (the quality is unclear)
      2. Guava MapMaker (is it based on #1?)

      #2 will require a huge 1.7MB Guava lib as a dependency for Cayenne. So maybe experiment with #1...

      3. Also was thinking of useing JDK ConcurrentHashMap, and implementing a FIFO eviction mechanism instead of LRU. FIFO should be easier to implement in our code. This change has a chance to cause havoc in Cayenne though (snapshots just loaded would get kicked out within the same transaction).

      Another issue which is agnostic to whatever implementation we'd chose, is what happens when certain operations become non-atomic when we remove synchronized blocks:

      synchronized (this)

      { processDeletedIDs(deletedSnapshotIds); processInvalidatedIDs(invalidatedSnapshotIds); processUpdateDiffs(diffs); sendUpdateNotification( event.getPostedBy(), diffs, deletedSnapshotIds, invalidatedSnapshotIds, indirectlyModifiedIds); }

      Anyways this will require some research and testing.

        Issue Links



            • Assignee:
              Andrus Adamchik
              Andrus Adamchik
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: