Uploaded image for project: 'Cocoon'
  1. Cocoon
  2. COCOON-1885

The EHDefaultStore returns in the size() method the wrong number of keys

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.1.9
    • 2.1.10, 2.2
    • * Cocoon Core
    • None

    Description

      The excalibut store interface defines a size() method for a store:

      /**
           * Returns count of the objects in the store, or -1 if could not be
           * obtained.
           */
      int size();

      What it not explicitely says, is that it is the number of keys in memoryStore (so not the diskStore) is needed. The StoreJanitor uses this size() to free some memory from cache when the JVM is low on memory. Since the current EHDefaultStore returns with size() ALL cachekeys (memoryStoreSize + diskStoreSize), it is quite likely when having a large cache that the StoreJanitor removes all cachekeys in memoryStore. Simply changing the size() method of EHDefaultStore to return the number of keys in memoryStore is sufficient. The JCSDefaultStore did implement it correctly already (though I do not see it in the cocoon trunk anymore..?)



      Attachments

        1. EHDefaultStore.patch
          0.9 kB
          Ard Schrijvers

        Activity

          People

            antonio Antonio Gallardo Rivera
            aschrijvers Ard Schrijvers
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: