History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CACHE-107
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Andres March
Reporter: kenneth chenis
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
OSCache

flushEntry does not behave correctly in cluster

Created: 08/Sep/04 03:37 PM   Updated: 23/Jan/05 04:58 PM
Component/s: Base Classes
Affects Version/s: 2.0.2
Fix Version/s: 2.1

Environment: Java 1.4.2 - any OS


 Description  « Hide
If a node in the cluster tries to flush a cache entry to force the invalidate on the cluster, it will fail unless the entry is already in the local cache.

Scenario:

NodeA reads ObjectA
NodeA caches ObjectA
NodeA create ListA with ObjectA in it
NodeA caches ListA
NodeB reads ObjectA
NodeB caches ObjectA
NodeB updates ObjectA
NodeB flushes ObjectA
NodeB flushes ListA

NodeA is left with a stale ListA, but an updated ObjectA because NodeB did not have a cached copy of ListA when it called the invalidate, thus the dispatch of the flush is never fired.

This is a simple change - around line 850 in Cache.java, move the event handler outside the if(!entry.isNew()) - this will fire the EntryFlush event to all the nodes even if the local node did not have a copy of the element in its cache.

Basically this is my suggestion on how to handle the "TODO:" in the code. We are seeing this issue because we use lists of elements, and cached XML entries that need to get invalidated by name when certain objects are written - the invalidates are forced in the DA layer, but only propogate if that particular element happens to already have been initialized in the local cache.

As a temporary work-around, you can force the entry to be added to
the cache before you call flushEntry:

admin.putInCache(name,null); // temp workaround
admin.flushEntry(name);

 All   Comments   Change History      Sort Order:
Andres March - [22/Sep/04 11:16 AM ]
Fixed as suggested.