This discussion is archived
0 Replies Latest reply: Jul 30, 2013 8:03 AM by 956039 RSS

How to invalidate the Resultcache in OSB?

956039 Newbie
Currently Being Moderated

HI,

I am trying to invalidate the entries in the result cache if there is change in the DB. As i don't know the Exact key structure what it is using,So i am going with the filters.

I followed the below link, But the code is in C++

https://blogs.oracle.com/jaylee/entry/osb_result_cache_invalidation_from

I tried to replicate the same in java. Below is my Java Client which i wrote in JavaEmbedded Activity of the Bpel process.

 

String name1=(String)((oracle.xml.parser.v2.XMLElement) getVariableData ("Receive1_receive_InputVariable","AccountdetailsCollection","/ns2:AccountdetailsCollection/ns2:Accountdetails/ns2:accountId")).getFirstChild().getNodeValue();

NamedCache cache=CacheFactory.getCache("/osb/service/ResultCache");  

    ValueExtractor extractor = new ReflectionExtractor("getToken");  

    Filter f1=new EqualsFilter(extractor,name1);

    Set setKeys = cache.keySet(f1);

    cache.keySet().removeAll(setKeys)

 

But i end up with the below error:

 

java.io.IOException: readObject failed: java.lang.IllegalStateException: ClassLoader "default.composite.SyncDBData.soa_0aeecf78-8a9e-4ad1-8908-c6e02bbbd4cc:3.1" (from Application component in user-defined-origin): This loader has been closed and should not be in use.

        at oracle.classloader.util.ClassLoadAsserts.fail(ClassLoadAsserts.java:154)

        at oracle.classloader.PolicyClassLoader.checkState(PolicyClassLoader.java:2106)

        at oracle.classloader.PolicyClassLoader.internalLoadClass(PolicyClassLoader.java:1713)

        at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1689)

        at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1674)

        at java.lang.Class.forName0(Native Method)

        at java.lang.Class.forName(Class.java:247)

        at com.tangosol.io.ResolvingObjectInputStream.resolveClass(ResolvingObjectInputStream.java:60)

        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1574)

        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)

        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731)

        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)

        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)

        at com.tangosol.util.ExternalizableHelper.readSerializable(ExternalizableHelper.java:2180)

        at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2311)

        at com.tangosol.util.ExternalizableHelper.deserializeInternal(ExternalizableHelper.java:2708)

        at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:262)

        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ConverterFromBinary.convert(PartitionedCache.CDB:4)

        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$Storage$BinaryEntry.getValue(PartitionedCache.CDB:13)

        at com.tangosol.util.extractor.AbstractExtractor.extractFromEntry(AbstractExtractor.java:115)

        at com.tangosol.util.InvocableMapHelper.extractFromEntry(InvocableMapHelper.java:294)

        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$Storage$BinaryEntry.extract(PartitionedCache.CDB:32)

        at com.tangosol.util.filter.ExtractorFilter.evaluateEntry(ExtractorFilter.java:94)

        at com.tangosol.util.InvocableMapHelper.evaluateEntry(InvocableMapHelper.java:262)

        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$Storage.query(PartitionedCache.CDB:139)

        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onQueryRequest(PartitionedCache.CDB:19)

        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$QueryRequest.run(PartitionedCache.CDB:1)

        at com.tangosol.coherence.component.net.message.requestMessage.DistributedCacheRequest.onReceived(DistributedCacheRequest.CDB:12)

        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onMessage(Grid.CDB:11)

        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:33)

        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService.onNotify(PartitionedService.CDB:3)

        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onNotify(PartitionedCache.CDB:3)

 

I came to know that i am passing wrong structure for the key. So can any one guide me in this regard.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points