Cache.RemoveIndex Does Not Seem To Remove The Index (Doc ID 876422.1)

Last updated on NOVEMBER 03, 2016

Applies to:

Oracle Coherence - Version 2.5.1 to 3.5.0
Information in this document applies to any platform.
***Checked for relevance on 02-Jan-2014***

Symptoms

When a.NET application calls Cache.RemoveIndex()  the index on the cache does not seem to be removed (The same will happen with a Java application).

Code like:

INamedCache cache = CacheFactory.GetCache("dist-cache");

// create a POF-based index on some first value in the stream
PofExtractor extractor = new PofExtractor(0);
cache.AddIndex(extractor, false, null);

// drop the index - should be removed so no problem is caused
cache.RemoveIndex(extractor); // <<-- does this method fail?

// wait a few seconds in case the index removal is asynchronous
// to allow removal to complete
System.Console.Out.WriteLine("Test going on");
Thread.Sleep(5000);

// insert a value incompatible with the POF extractor index
// should be no problem beacuae the index has been removed
// appears the RemoveIndex() method fails

cache.Add(key, val); // <<-- this line causes an exception
                     //      in the cache server log

 

runs into PofNavigationException on the cache server:

2009-07-10 14:27:25.781/29.313 Oracle Coherence GE 3.5/459 <Error> (thread=DistributedCache, member=1): Exception occured during index update: key; removing the index...
2009-07-10 14:27:25.781/29.313 Oracle Coherence GE 3.5/459 <Error> (thread=DistributedCache, member=1):
com.tangosol.io.pof.reflect.PofNavigationException: getChild() method cannot be invoked on the SimplePofValue instance.
at com.tangosol.io.pof.reflect.SimplePofValue.getChild(SimplePofValue.java:45)
at com.tangosol.io.pof.reflect.AbstractPofPath.navigate(AbstractPofPath.java:32)
at com.tangosol.util.extractor.PofExtractor.extractFromEntry(PofExtractor.java:110)
at com.tangosol.util.InvocableMapHelper.extractFromEntry(InvocableMapHelper.java:292)
at com.tangosol.util.SimpleMapIndex.insert(SimpleMapIndex.java:118)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$Storage.updateIndex(DistributedCache.CDB:19)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$Storage.postInvoke(DistributedCache.CDB:6)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$Storage.put(DistributedCache.CDB:156)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache.onPutRequest(DistributedCache.CDB:37)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$PutRequest.run(DistributedCache.CDB:1)
at com.tangosol.coherence.component.net.message.requestMessage.DistributedCacheKeyRequest.onReceived(DistributedCacheKeyRequest.CDB:12)
at com.tangosol.coherence.component.net.message.requestMessage.distributedCacheKeyRequest.ExtendedKeyRequest.onReceived(ExtendedKeyRequest.CDB:4)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onMessage(Grid.CDB:9)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:136)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache.onNotify(DistributedCache.CDB:3)
at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:37)
at java.lang.Thread.run(Thread.java:619)

This shows that when the cache.Add() is executed the index still exists and has not been removed.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms