Commits

Anonymous committed 867a1f4

Issue number: CACHE-107
Submitted by: Andres March

Fixes issue with flushing of entries in a cluster where the entry being flushed does not exist locally.

Comments (0)

Files changed (1)

src/core/java/com/opensymphony/oscache/base/Cache.java

             // Update the entry's state in the map
             cacheMap.put(key, entry);
 
-            // Trigger an ENTRY_FLUSHED event
-            CacheEntryEvent event = new CacheEntryEvent(this, entry, origin);
-            dispatchCacheEntryEvent(CacheEntryEventType.ENTRY_FLUSHED, event);
         } else {
             // The entry did not exist in the cache anyway, nothing to flush
             // TODO: Do we need an event for this?
         }
+        // Trigger an ENTRY_FLUSHED event. [CACHE-107] Do this for all flushes.
+        CacheEntryEvent event = new CacheEntryEvent(this, entry, origin);
+        dispatchCacheEntryEvent(CacheEntryEventType.ENTRY_FLUSHED, event);
     }
 }