0 Replies Latest reply: Aug 22, 2013 4:37 AM by 956039 RSS

    OSB Resultcache Invalidation

    956039

      Hi,

      I am trying to invalidate the resultcache in OSB. As we don't know the correct format of key structure, I tried with using filters.

      Below is my client code to invalidate the Resultcache

       

      package com.service;

       

      import java.util.Set;

       

      import com.tangosol.net.CacheFactory;

      import com.tangosol.net.NamedCache;

      import com.tangosol.util.Filter;

      import com.tangosol.util.ValueExtractor;

      import com.tangosol.util.extractor.ReflectionExtractor;

      import com.tangosol.util.filter.EqualsFilter;

       

      public class ResultcacheInvalidation {

       

          /**

           * @param args

           */

          public static void main(String[] args)

          {

             

              System.setProperty("tangosol.coherence.cluster", "OSB-cluster");            

              System.setProperty("tangosol.coherence.override","D:/Oracle/Middleware/user_projects/domains/soa_domain/config/osb/coherence/osb-coherence-override.xml");            

              System.setProperty("tangosol.coherence.cacheconfig","D:/Oracle/Middleware/user_projects/domains/soa_domain/config/osb/coherence/osb-coherence-cache-config.xml");

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

              ValueExtractor extractor = new ReflectionExtractor("getToken");       

              Filter f1=new EqualsFilter(extractor,3);    

              Set setKeys = cache.keySet(f1);

              System.out.println(setKeys);

              cache.keySet().removeAll(setKeys);

          }

       

      }

       

      But i am end up with below error

       

      2013-08-22 15:01:34.298/1.593 Oracle Coherence 3.6.0.4 <Info> (thread=main, member=n/a): Loaded operational configuration from "jar:file:/C:/Users/Praveen/workspace/WIFPOC/CustomerDetailsService/WebContent/WEB-INF/lib/coherence.jar!/tangosol-coherence.xml"

      2013-08-22 15:01:34.345/1.640 Oracle Coherence 3.6.0.4 <Info> (thread=main, member=n/a): Loaded operational overrides from "file:/D:/Oracle/Middleware/user_projects/domains/soa_domain/config/osb/coherence/osb-coherence-override.xml"

      2013-08-22 15:01:34.370/1.665 Oracle Coherence 3.6.0.4 <D5> (thread=main, member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified

       

      Oracle Coherence Version 3.6.0.4 Build 19111

      Grid Edition: Development mode

      Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

       

      2013-08-22 15:01:35.167/2.462 Oracle Coherence GE 3.6.0.4 <Info> (thread=main, member=n/a): Loaded cache configuration from "file:/D:/Oracle/Middleware/user_projects/domains/soa_domain/config/osb/coherence/osb-coherence-cache-config.xml"

      2013-08-22 15:01:36.217/3.512 Oracle Coherence GE 3.6.0.4 <Warning> (thread=main, member=n/a): Local address "127.0.0.1" is a loopback address; this cluster node will not connect to nodes located on different machines

      2013-08-22 15:01:36.408/3.703 Oracle Coherence GE 3.6.0.4 <D4> (thread=main, member=n/a): TCMP bound to /127.0.0.1:7894 using SystemSocketProvider

      2013-08-22 15:01:36.938/4.233 Oracle Coherence GE 3.6.0.4 <Info> (thread=Cluster, member=n/a): This Member(Id=3, Timestamp=2013-08-22 15:01:36.909, Address=127.0.0.1:7894, MachineId=41624, Location=process:4084, Role=ServiceResultcacheInvalidation, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=2) joined cluster "OSB-cluster" with senior Member(Id=1, Timestamp=2013-08-22 13:34:35.437, Address=127.0.0.1:7890, MachineId=41624, Location=process:7684, Role=OSB-node, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=2)

      2013-08-22 15:01:36.946/4.241 Oracle Coherence GE 3.6.0.4 <D5> (thread=Cluster, member=n/a): Member(Id=2, Timestamp=2013-08-22 14:16:02.63, Address=127.0.0.1:7892, MachineId=41624, Location=process:7684, Role=WeblogicServer) joined Cluster with senior member 1

      2013-08-22 15:01:36.963/4.258 Oracle Coherence GE 3.6.0.4 <D5> (thread=Cluster, member=n/a): Member(Id=4, Timestamp=2013-08-22 14:19:28.55, Address=127.0.0.1:7896, MachineId=41624, Location=process:5724, Role=CoherenceConsole) joined Cluster with senior member 1

      2013-08-22 15:01:36.968/4.263 Oracle Coherence GE 3.6.0.4 <D5> (thread=Cluster, member=n/a): Member 1 joined Service Cluster with senior member 1

      2013-08-22 15:01:36.968/4.263 Oracle Coherence GE 3.6.0.4 <D5> (thread=Cluster, member=n/a): Member 1 joined Service Management with senior member 1

      2013-08-22 15:01:36.968/4.263 Oracle Coherence GE 3.6.0.4 <D5> (thread=Cluster, member=n/a): Member 1 joined Service ORA-OSB-deployments with senior member 1

      2013-08-22 15:01:36.971/4.266 Oracle Coherence GE 3.6.0.4 <D5> (thread=Cluster, member=n/a): Member 2 joined Service Cluster with senior member 1

      2013-08-22 15:01:36.971/4.266 Oracle Coherence GE 3.6.0.4 <D5> (thread=Cluster, member=n/a): Member 2 joined Service Management with senior member 1

      2013-08-22 15:01:36.972/4.267 Oracle Coherence GE 3.6.0.4 <D5> (thread=Cluster, member=n/a): Member 2 joined Service DistributedReadWriteCache with senior member 2

      2013-08-22 15:01:36.972/4.267 Oracle Coherence GE 3.6.0.4 <D5> (thread=Cluster, member=n/a): Member 4 joined Service Cluster with senior member 1

      2013-08-22 15:01:36.972/4.267 Oracle Coherence GE 3.6.0.4 <D5> (thread=Cluster, member=n/a): Member 4 joined Service Management with senior member 1

      2013-08-22 15:01:36.972/4.267 Oracle Coherence GE 3.6.0.4 <D5> (thread=Cluster, member=n/a): Member 4 joined Service ORA-OSB-deployments with senior member 1

      2013-08-22 15:01:36.972/4.267 Oracle Coherence GE 3.6.0.4 <D5> (thread=Cluster, member=n/a): Member 4 joined Service DistributedReadWriteCache with senior member 2

      2013-08-22 15:01:36.974/4.269 Oracle Coherence GE 3.6.0.4 <Info> (thread=main, member=n/a): Started cluster Name=OSB-cluster

       

      WellKnownAddressList(Size=3,

        WKA{Address=127.0.0.1, Port=9999}

        WKA{Address=127.0.0.1, Port=7890}

        WKA{Address=127.0.0.1, Port=8888}

        )

       

      MasterMemberSet

        (

        ThisMember=Member(Id=3, Timestamp=2013-08-22 15:01:36.909, Address=127.0.0.1:7894, MachineId=41624, Location=process:4084, Role=ServiceResultcacheInvalidation)

        OldestMember=Member(Id=1, Timestamp=2013-08-22 13:34:35.437, Address=127.0.0.1:7890, MachineId=41624, Location=process:7684, Role=OSB-node)

        ActualMemberSet=MemberSet(Size=4, BitSetCount=2

          Member(Id=1, Timestamp=2013-08-22 13:34:35.437, Address=127.0.0.1:7890, MachineId=41624, Location=process:7684, Role=OSB-node)

          Member(Id=2, Timestamp=2013-08-22 14:16:02.63, Address=127.0.0.1:7892, MachineId=41624, Location=process:7684, Role=WeblogicServer)

          Member(Id=3, Timestamp=2013-08-22 15:01:36.909, Address=127.0.0.1:7894, MachineId=41624, Location=process:4084, Role=ServiceResultcacheInvalidation)

          Member(Id=4, Timestamp=2013-08-22 14:19:28.55, Address=127.0.0.1:7896, MachineId=41624, Location=process:5724, Role=CoherenceConsole)

          )

        RecycleMillis=1200000

        RecycleSet=MemberSet(Size=0, BitSetCount=0

          )

        )

       

      TcpRing{Connections=[2]}

      IpMonitor{AddressListSize=0}

       

      2013-08-22 15:01:37.024/4.319 Oracle Coherence GE 3.6.0.4 <D5> (thread=Invocation:Management, member=3): Service Management joined the cluster with senior service member 1

      2013-08-22 15:01:37.370/4.665 Oracle Coherence GE 3.6.0.4 <D5> (thread=DistributedCache:ORA-OSB-deployments, member=3): Service ORA-OSB-deployments joined the cluster with senior service member 1

      2013-08-22 15:01:37.486/4.781 Oracle Coherence GE 3.6.0.4 <D4> (thread=DistributedCache:ORA-OSB-deployments, member=3): Asking member 1 for 128 primary partitions

      Exception in thread "main" (Wrapped: Failed request execution for ORA-OSB-deployments service on Member(Id=1, Timestamp=2013-08-22 13:34:35.437, Address=127.0.0.1:7890, MachineId=41624, Location=process:7684, Role=OSB-node)) java.lang.RuntimeException: Missing or inaccessible method: com.bea.alsb.coherence.impl.CacheValue.getToken()

          at com.tangosol.util.Base.ensureRuntimeException(Base.java:293)

          at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.tagException(Grid.CDB:36)

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

          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)

          at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)

          at java.lang.Thread.run(Thread.java:662)

      Caused by: java.lang.RuntimeException: Missing or inaccessible method: com.bea.alsb.coherence.impl.CacheValue.getToken()

          at com.tangosol.util.extractor.ReflectionExtractor.extract(ReflectionExtractor.java:113)

          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)

          ... 8 more

      2013-08-22 15:01:37.553/4.848 Oracle Coherence GE 3.6.0.4 <D4> (thread=ShutdownHook, member=3): ShutdownHook: stopping cluster node

      2013-08-22 15:01:37.555/4.850 Oracle Coherence GE 3.6.0.4 <D5> (thread=Cluster, member=3): Service Cluster left the cluster

       

      Is there a way to invalidate the resultcache of OSB?

      So any suggestions would be greatly appreciated.