External Coherence Cache

Hello,
Started using Coherence 3.6 and no issues in going through the tutorial.
Also, from the web application code, was able to use weblogic server internal coherence cache.
I want help for setting up the external Coherence cache. Any pointers ?
Thank you for y our help.

Hi,
The Coherence product has a folder /bin where you will find script for running standalone/external Coherence cache servers.
-cache-server.cmd : Execute multiple times the script and you will have multiple external coherence cache servers that can store/compute data
-query.cmd: Execute sql like scripts to verify the data loaded the the Coherence Grid (Read the documentation at http://download.oracle.com/docs/cd/E15357_01/coh.360/e15723/api_cq.htm)
-coherence.cmd: Execute for querying the Coherence Grid (Type help for commands)
Also, I would recommend you to go through the developers' guide and Java APIs for understanding the Coherence capabilities. Here is the list of links that may be helpful for you. http://ora-soa.blogspot.com/2011/07/where-to-start-learning-coherence.html
Cheers,
NJ

Similar Messages

  • CQL Join on Coherence Cache with Composite Key

    I have a Coherence Cache with a composite key and I want to join a channel to records in that cache with a CQL processor. When I deploy the package containing the processor, I get the following error:
    +italics14:32:35,938 | alter query SimpleQuery start                                                                        | [ACTIVE] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)' | CQLServer | FATAL+
    +14:32:35,938 | alter query >>SimpleQuery<< start+
    +specified predicate requires full scan of external source which is not supported. please modify the join predicate | [ACTIVE] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)' | CQLServer | FATAL+
    I think that I'm using the entire key. If I change the key to a single field, it deploys OK. I found a similar issue when I defined a Java class to represent the composite key. Is it possible to join in this way on a composite key cache?
    I could define another field which is a concatenation of the fields in the composite key but this is a little messy.
    My config is as below:
    <wlevs:caching-system id="MyCache" provider="coherence" />
    <wlevs:event-type-repository>
    <wlevs:event-type type-name="SimpleEvent">
              <wlevs:properties>
                   <wlevs:property name="field1" type="char" />
                   <wlevs:property name="field2" type="char" />
              </wlevs:properties>
    </wlevs:event-type>
    </wlevs:event-type-repository>
         <wlevs:channel id="InChannel" event-type="SimpleEvent" >
              <wlevs:listener ref="SimpleProcessor" />
         </wlevs:channel>
         <wlevs:processor id="SimpleProcessor">
              <wlevs:listener ref="OutChannel" />
              <wlevs:cache-source ref="SimpleCache" />
         </wlevs:processor>
         <wlevs:channel id="OutChannel" event-type="SimpleEvent" >
         </wlevs:channel>
         <wlevs:cache id="SimpleCache" value-type="SimpleEvent"
              key-properties="field1,field2"
              caching-system="MyCache" >
         </wlevs:cache>
    and the processor CQL is as follows:
    <processor>
    <name>SimpleProcessor</name>
    <rules>
    <query id="SimpleQuery">
    <![CDATA[ 
                select I.field1, I.field2 from InChannel [now] as I,
    SimpleCache as S where
    I.field1 = S.field1 and
    I.field2 = S.field2
    ]]> </query>
    </rules>
    </processor>
    Thanks
    Mike

    Unfortunately, joining on composite keys in Coherence is not supported in the released versions. This will be supported in 12g release.
    As you mention, defining another field as key, which is the concatenation of the original keys is the workaround.

  • JMX monitoring front Coherence cache running on IBM WebSphere

    I have a question regarding JMX monitoring a Coherence front cache running in a IBM WebSphere v6.1 JVM (1.5).
    My setup is that I have three Coherence nodes (back cache) each running 10 JVMs each. Via JMX all these 30 JVMs are setup to be monitored from one of the 30 JVMs which is configured to be the JmxServer for the other 29 instances. The other 29 JVMs set -Dtangosol.coherence.management.remote=true at startup to indicate that their MBean tree will be managed centrally. This works fine but when I try to extend this to also be able to manage the front cache (running on WebSphere on a separate node in the tier above) by adding the same flag (-Dtangosol.coherence.management.remote=true) it does not appear in the MBean tree as the other 30 Coherence cache (Sun) JVMs do.
    Are there other things I have to consider to get this working? There are no firewalls in between the nodes so that is not the problem. How much of IBM WebSpheres (non-standard) JMX-functionality is required to get this to work?
    /Jonas

    How is the WebSphere node connected to the cluster? Is it using TCMP? Extend?
    Local, Distributed, Replicated, Near, Overflow, External and Optimistic cache statistics appear in the Coherence JMX server. However, near and local caches created on extend nodes do not appear. Therefore the -Dtangosol.coherence.management.remote=true on an Extend client will not register the near or local caches.
    Thanks,
    Everett

  • Specifying coherence-cache-config.xml for multiple clusters

    Hi,
    I am running two cache clusters (Cluster A and B that hold different cache types). we have a web application that needs to communicate with both the clusters. we have two coherence-cache-config-g.xml files, one for each cluster.
    where do we specify the two coherence-cache-config.xml for each of these clusters in our coherence.jar that we deploy on the web app server.
    pls provide some inputs...
    thanks in advance,
    - G.

    Hi G,
    You can define a path to the cache configuration descriptor in your operation configuration override file (tangosol-coherence=override.xml) or specify it in the system property "tangosol.coherence.cacheconfig".
    Please see this Wiki page for details:
    http://wiki.tangosol.com/display/COH32UG/configurable-cache-factory-config
    Regards,
    Gene

  • How to specify index for cache in coherence-cache-config.xml

    Hi All,
    We want to apply indexing on cache data.
    Suppose i have a EMPLOYEE object in coherence cache.
    and i want to use employeeID for indexing purpose.
    Can anybody help me to achieve this at Congregational level i.e. using xml file (coherence-cache-config.xml) .
    Edited by: 981644 on Jan 16, 2013 1:51 AM

    Hi,
    I've posted some [url http://coherence.oracle.com/download/attachments/14647422/add-index-namespace.jar]code and the [url http://coherence.oracle.com/download/attachments/14647422/add-index-namespace-src.jar]source. It depends on coherence common version 2.3.0.39174 however I believe it will work with 2.0.0.23649 also. Coherence common library can be downloaded from [url http://coherence.oracle.com/display/INC10/coherence-common]here
    Note: This is purely an example on how to achieve index creation via a cache configuration file and is not a part of the product thus is not covered by product support.
    Here is an example cache configuration that uses the namespace:
    <cache-config xmlns:service="class://com.oracle.coherence.environment.extensible.ServiceOperations">
        <caching-scheme-mapping>
            <service:index-add cache-name="dist-indexes">
                <extractor>
                    <class-name>ReflectionExtractor</class-name>
                    <init-params>
                        <init-param>
                            <param-type>string</param-type>
                            <param-value>getName</param-value>
                        </init-param>
                    </init-params>
                </extractor>
            </service:index-add>
            <!-- Simplified POF Config -->
            <service:index-add cache-name="dist-indexes" pof-enabled="true">
                <pof-index>8,16,32</pof-index>
            </service:index-add>
            <!-- This should not be counted based on system-property override -->
            <service:index-add cache-name="dist-indexes" pof-enabled="true" enabled="{tangosol.index.add}">
                <pof-index>8,16,31</pof-index>
            </service:index-add>
            <!-- Explicit POF Config -->
            <service:index-add cache-name="dist-indexes">
                <extractor>
                    <class-name>PofExtractor</class-name>
                    <init-params>
                        <init-param>
                            <param-type>{class}</param-type>
                            <param-value>null</param-value>
                        </init-param>
                        <init-param>
                            <param-type>{object}</param-type>
                            <param-value>
                                <class-name>com.tangosol.io.pof.reflect.SimplePofPath</class-name>
                                <init-params>
                                    <init-param>
                                        <param-type>{int[]}</param-type>
                                        <param-value>1,2,4</param-value>
                                    </init-param>
                                </init-params>                     
                            </param-value>
                        </init-param>
                    </init-params>
                </extractor>
            </service:index-add>
        </caching-scheme-mapping>
    </cache-config>Thanks,
    Harvey

  • How to share the same coherence cache in two EPN

    hi,all:
    I need to share the same coherence cache in two EPN. to put data into this coherence cache.
    only whe EPN can been deploy ok, the other EPN deploy will get below exception.
    Caused By: java.lang.IllegalStateException: Service "synergy-scheme-service" has been started by the factory with a different configuration descriptor
    at com.tangosol.net.DefaultConfigurableCacheFactory.validateBackingMapManager(DefaultConfigurableCacheFactory.java:1246)
    who can tell me why? or who can give me a example on how to share the same coherence cache in two EPN.
    thanks a lots

    Hi,
    This is because the system detects that you are using different configuration for the cache of the same name(and the domain name). If you want, we can discuss it, my mail is [email protected]
    Thanks
    Junger

  • Looking for some advice on CEP HA and Coherence cache

    We are looking for some advice or recommendation on CEP architecture.
    We need to build a CEP application that conforms to the following:
    • HA with no loss of events or duplicate events when failing over to the backup server.
    • We have some aggregative rules that needs to see all events.
    • Events are XMLs with size of 3KB-50KB. Not all elements are needed for the rules but they are there for other systems that come after the CEP (the customer services).
    • The XML elements that the CEP needs are in varying depth in the XML.
    Running the EPN on a single thread is not fast enough for the required throughput mainly because network latency to the JMS and the heavy task of parsing of the XML. Because of that we are looking for a solution that will read the messages from the JMS in parallel (multi thread) but will keep the same order of events between the Primary and Secondary CEPs.
    One idea that came to our minds is to use Coherence cache in the following way:
    • On the CEP inbound use a distributed queue and not topic (at the CEP outbound it is still topic).
    • On the CEPs side use a Coherence cache that runs on the CEPs JVMs (since we already have a Coherence cluster for HA).
    • Both CEPs read from the queue using multi threading (10 reading threads – total of 20 threads) and putting it to the Coherence cache.
    • The Coherence cache is publishing the events to both CEPs on a single thread.
    The EPN looks something like this:
    JMS adapter (multi threaded) -> replicated cache on both CEPs -> event bean -> HA adapter -> channel -> processor -> ….
    Does this sounds sound to you?
    Are we over shooting here? Is there a simpler solution for our needs?
    Is there a best practice for such requirements?
    Thanks

    Hi,
    Just to make it clear:
    We do not parse the XML on the event bean after the Coherence. We do it on the JMS adapter on multiple threads in order to utilize all the server resources (CPUs) and then we put it in the replicated cache.
    The requirements from our application are:
    - There is an aggregative query that needs to "see" all events (this means that we need to pass all events thru a single processor and we cannot partition them to several processors).
    - Because this is a HA solution the events on both CEPs (primary and secondary) needs to be at the same order when reaching the HA inbound adapter and the processor.
    - A single thread JMS adapter is not reading the messages from the JMS fast enough mainly because it takes time to parse the XML to an event.
    - Using a multi-threaded adapter or many single threaded adapters with message selector will create a situation that the order of events on both CEPs will not be the same at the processor inbound.
    This is why we needed a mediator so we can read in multiple threads that will parse the XMLs in parallel without concerning on order of messages and on the other hand publish all the messages on a single thread to the processors on both CEPs from this shared mediator (we use a replicated cache that runs on both JVMs).
    We use queue instead of topic because if we read the messages from a topic on both CEPs it will be stored twice on the Coherence replicated cache. But if we use a queue, when server 1 read the message and put it in the Coherence replicated cache then server 2 will not read it because it was removed from the queue.
    If I understand correctly you are suggesting replacing the JMS adapter with an event bean that will read the messages from the JMS directly?
    Are you also suggesting that we will not use a replicated cache but instead a stand alone cache on each server? In this case how do we keep the same order of events on both CEPs (on both caches)?

  • Verify whether the session data is kept in the Coherence caches

    I have successfully combined the MapViewer application with WebLogic and Oracle Coherence*Web.
    How to verify whether the session data of MapViewer application is kept in the Coherence caches or not?
    All out put show that both of MapViewer and WebLogic server as well as Coherence are running well.
    All the following steps are right?
    The procedure is as the following:
    1. Create a WebLogic domain: Map_domain.
    2. Start the WebLogic domain Map_domain by running startWebLogic.sh script.
    3. Install Coherence.jar as a library on WebLogic.
    4. Copy the coherence.jar in the WAR's WEB-INF/lib directory.
    5. Create a reference to the shared library by modifying the weblogic.xml in web applications WEB-INF directory
    and add the following contents:
    <weblogic-web-app>
         <library-ref>
              <library-name>coherence-web-spi</library-name>
              <specification-version>1.0.0.0</specification-version>
              <implementation-version>1.0.0.0</implementation-version>
              <exact-match>false</exact-match>
         </library-ref>
    <weblogic-web-app>6. Install Coherence-web-spi.war as a WebLogic library.
    7. Install the MapViewer as a WebLogic application.
    8. Start a Coherence cache server using the cmd file web-cache-server.cmd and then start MapViewer application.
    The content of web-cache-server.cmd file:
    @echo off
    @rem This will start a cache server
    setlocal
    :config
    @rem specify the Coherence installation directory
    set coherence_home=F:\coherence
    @rem specify the JVM heap size
    set memory=256m
    :start
    if not exist "%coherence_home%\lib\coherence.jar" goto instructions
    if "%java_home%"=="" (set java_exec=java) else (set java_exec=%java_home%\bin\java)
    :launch
    set java_opts="-Xms%memory% -Xmx%memory%"
    "%java_exec%" -server -showversion "%java_opts%" -cp %coherence_home%\lib\coherence.jar;
    %coherence_home%\lib\coherence-web-spi.war
    -Dtangosol.coherence.management.remote=true
    -Dtangosol.coherence.cacheconfig=WEB-INF/classes/session-cache-config.xml
    -Dtangosol.coherence.session.localstorage=true
    com.tangosol.net.DefaultCacheServer %1
    goto exit
    :instructions
    echo Usage:
    echo   ^<coherence_home^>\bin\cache-server.cmd
    goto exit
    :exit
    endlocal
    @echo onEdited by: jetq on Jan 13, 2010 9:32 AM

    Any opinions are welcome.

  • Implementing Oracle DCN with Coherence Cache in a weblogic 10 app server

    I m trying to implements a DCN ( Database change notification ) on oracle to notify a listener of an event of DB so I can update Coherence Cache.
    I followed the tutorial here and it is working fine using a sample program with a main method to execute the listener class and keep it running.
    My question is how would this notification and listener gets implemented on a production environment since my local test was only running a main method to keep the listener running? what technology to use to keep the listener always running on the background and receive the notification from the database )?
    would a [weblogic startup class|http://docs.oracle.com/cd/E13222_01/wls/docs81/ConsoleHelp/startup_shutdown.html] work for this purpose?
    We are using Weblogic 10 as our app server.

    That's a very simple question with (many) potentially complex answers. I think that first uou need to study information on TimesTen to understand what it is and what it does. Then you need to relate that to you current performance bottleneck (I assume you have analysed those). If your bottleneck is database access then maybe TimesTen can help you.
    Please bear in mind that TimesTen is not a 'transparent' drop in performance booster. To implement TimesTen and to realise significant performance improvement you will almost certainly need to make changes to both the application and the overall architecture. The cost/difficulty of doing that also needs to be factored in.
    Chris

  • Need a help to update coherence cache values in c++

    Hi,
    I need to update coherence cache value of a particular object.
    Managed<ExposureHolderContract>::Handle contract =
    cast<Managed<ExposureHolderContract>::Handle>(cache->get(vsName));
    contract->setName("dsafd");
    When i try to cast to a ManagedObject:: Handle it says
    coherence::lang::ConstCastException: attempt to cast from a "const coherence::lang::Managed<ExposureHolderContract>" to a "coherence::lang::Managed<ExposureHolderContract>"
    at void coherence::lang::coh_throw_const_cast(const std::type_info&, const std::type_info&)(ConstCastException.cpp:27)
    at coherence::lang::coh_throw_const_cast(std::type_info const&, std::type_info const&)
    <stack frame symbol unavailable>
    <stack frame symbol unavailable>
    <stack frame symbol unavailable>
    <stack frame symbol unavailable>
    <stack frame symbol unavailable>
    at __libc_start_main
    on thread "main"
    In the documentation it says in order to call non static methods we need to retrieve the handle.
    but when I try to cast to a handle it fails.
    I'm inserting data to coherence cache by calling Managed::create method. Is this method making immutable object.
    ExposureHolderContract tempEhc(contractId, name, date, age, weight);
    Managed<ExposureHolderContract>::Handle ss = Managed<ExposureHolderContract>::create(tempEhc);
    cache->put(String::create(contractId.c_str()), ss);
    Please help me to update the recorde value.
    regards,
    sura

    Hi Sura,
    It is a matter of safety and correctness. The in-process caches return a locally held object, and thus if you made some change to it, that change would be visible within the in-process cache, while not visible to the remote cache. Thus future access to the in-process cache would see a value which does not actually exist in the remote cache. While it is true that if you modify it with the intent to immediately re-insert it this shrinks the window of incorrectness that window still exists, and of course the cache has no idea if you will ever reinsert the value. As for the effect on performance it should be insignificant if you actually do put it back in the cache as the cost of a cache update will easily be multiple orders of magnitude greater then the cost of the clone. Also remember there is no requirement to clone a value if you don't intend to mutate it, you can safely use it via the View. So the only time the performance cost of the clone could be considered significant is when you intend to mutate but not reinsert the data, but a clone is also necessary there as not cloning it would leave the in-process cache in an inconsistent state with respect to the remote cache.
    Mark
    Oracle Coherence

  • How to Test coherence cache configuration

    Hi,
    I have configured coherence using the below two config xmls, I had started out by trying to configure a distributed cache scheme but I am not sure if it has come up correctly. This configuration works fine from caching point of view, it even does the clustering, but my only doubt here is that how can I test whether it is actually a distributed cache or a replicated cache?
    coherence-cache-config.xml
    <cache-config>
         <caching-scheme-mapping>
              <cache-mapping>
                   <cache-name>dist-ABCCache</cache-name>
                   <scheme-name>ABC-distributed-cache-scheme</scheme-name>
              </cache-mapping>
         </caching-scheme-mapping>
         <caching-schemes>
              <!--
    Distributed caching scheme.
    -->
              <distributed-scheme>
                   <scheme-name>ABC-distributed-cache-scheme</scheme-name>
                   <lease-granularity>member</lease-granularity>
                   <backing-map-scheme>
                        <local-scheme/>
                   </backing-map-scheme>
                   <autostart>true</autostart>
              </distributed-scheme>
              <proxy-scheme>
                   <service-name>ExtendTcpProxyService</service-name>
                   <thread-count>5</thread-count>
                   <acceptor-config>
                        <tcp-acceptor>
                             <local-address>
                                  <address>server1</address>
                                  <port>####</port>
                             </local-address>
                        </tcp-acceptor>
                   </acceptor-config>
                   <autostart>true</autostart>
              </proxy-scheme>
         </caching-schemes>
    </cache-config>
    tangosol-coherence-override.xml
    <coherence>
         <cluster-config>
              <member-identity>
                   <cluster-name>MyCluster</cluster-name>
              </member-identity>
              <unicast-listener>
                   <well-known-addresses>
                        <socket-address id="1">
                             <address>server1</address>
                             <port>####</port>
                             <port-auto-adjust>false</port-auto-adjust>
                        </socket-address>
                        <socket-address id="2">
                             <address>server2</address>
                             <port>####</port>
                             <port-auto-adjust>false</port-auto-adjust>
                        </socket-address>                    
                   </well-known-addresses>
              </unicast-listener>
              <multicast-listener>
                   <time-to-live system-property="tangosol.coherence.ttl">4</time-to-live>
                   <join-timeout-milliseconds>3000</join-timeout-milliseconds>
              </multicast-listener>
              <packet-publisher>
                   <packet-delivery>
                        <timeout-milliseconds>30000</timeout-milliseconds>
                   </packet-delivery>
              </packet-publisher>
              <service-guardian>
                   <timeout-milliseconds system-property="tangosol.coherence.guard.timeout">35000
                   </timeout-milliseconds>
              </service-guardian>
         </cluster-config>
         <logging-config>
              <severity-level system-property="tangosol.coherence.log.level">9</severity-level>
              <character-limit system-property="tangosol.coherence.log.limit">0</character-limit>
         </logging-config>
    </coherence>

    user1945969 wrote:
    Thanks for your answer but I also wanted to know if there is anyway I can verify that by the data in the cluster? You can start up the [command line application|http://coherence.oracle.com/pages/viewpage.action?pageId=16684] or write a quick class to display the information for that particular cache.
    I mean can check what all data is present in each cluster member?I would suggest taking a look via JMX. In this case, you would want to look at the ServiceMBean, CacheMBean and StorageManagerMBean MBeans (take a look at the Registry for more information).
    Another reason why I am not so confident if this scheme is distributed or not is that, in my config xml I do not have any backing map scheme configured so how is coherence going to do the backups in this case?
    <backing-map-scheme>
         <local-scheme/>
    </backing-map-scheme>You do have a "backing map" configured, it will just use the defaults.
    Coherence always manages the backups automatically, transparently and dynamically for you. When using the partitioned cache (i.e. "distributed-scheme") Coherence will place the backup in a storage enabled node on a separate physical machine as the primary.
    Rob
    :Coherence Team:

  • Verify if the sessision data of MapViewer app is stored in Coherence caches

    I have successfully combined the MapViewer application with WebLogic and Oracle Coherence*Web.
    How to verify whether the session data of MapViewer application is kept in the Coherence caches or not?
    All out put show that both of MapViewer and WebLogic server as well as Coherence are running well.
    All the following steps are right?
    The procedure is as the following:
    1. Create a WebLogic domain: Map_domain.
    2. Start the WebLogic domain Map_domain by running startWebLogic.sh script.
    3. Install Coherence.jar as a library on WebLogic.
    4. Copy the coherence.jar in the WAR's WEB-INF/lib directory.
    5. Create a reference to the shared library by modifying the weblogic.xml in web applications WEB-INF directory
    and add the following contents:
    <weblogic-web-app>
         <library-ref>
              <library-name>coherence-web-spi</library-name>
              <specification-version>1.0.0.0</specification-version>
              <implementation-version>1.0.0.0</implementation-version>
              <exact-match>false</exact-match>
         </library-ref>
    <weblogic-web-app>6. Install Coherence-web-spi.war as a WebLogic library.
    7. Install the MapViewer as a WebLogic application.
    8. Start a Coherence cache server using the cmd file web-cache-server.cmd and then start MapViewer application.
    The content of web-cache-server.cmd file:
    @echo off
    @rem This will start a cache server
    setlocal
    :config
    @rem specify the Coherence installation directory
    set coherence_home=F:\coherence
    @rem specify the JVM heap size
    set memory=256m
    :start
    if not exist "%coherence_home%\lib\coherence.jar" goto instructions
    if "%java_home%"=="" (set java_exec=java) else (set java_exec=%java_home%\bin\java)
    :launch
    set java_opts="-Xms%memory% -Xmx%memory%"
    "%java_exec%" -server -showversion "%java_opts%" -cp %coherence_home%\lib\coherence.jar;
    %coherence_home%\lib\coherence-web-spi.war
    -Dtangosol.coherence.management.remote=true
    -Dtangosol.coherence.cacheconfig=WEB-INF/classes/session-cache-config.xml
    -Dtangosol.coherence.session.localstorage=true
    com.tangosol.net.DefaultCacheServer %1
    goto exit
    :instructions
    echo Usage:
    echo   ^<coherence_home^>\bin\cache-server.cmd
    goto exit
    :exit
    endlocal
    @echo onEdited by: jetq on Jan 12, 2010 9:02 PM

    Any opinions are welcome.

  • Does coherence cache the value from the cache?

    Hi, I have the question about if the coherence caches the value from the cache? I believe it does from my test, just want to get the confirmation.
    I like to use an example to describe my question. For example:
    If (key1, value1) are in the cache1, (value1 is an object),
    for the first time, if cache1.get(key1), coherence will deserialize value1 and return. But if in the same JVM, when cache1.get(key1) is invoked again, coherence will return value1, which I believe is cached by coherence in the current JVM, and return; instead of deserializing and return it. Is that right?
    I am asking this question because I found a problem in our project when use coherence. As the above example, if I use value1 = cache1.get(key1), and in our project, value1 object has a set method to change one of its internal attributes, and this method was indeed invoked after value1 get from cache1. Then in another class, value2 = cache1.get(key1) is called again, and I found out that value2's attribute will have the modified value, even cache1.put(key1, value1) is never invoked in the first place.
    Of course, this kind of behavior matches the java.util.Map. But coherence cache is a cluster/distributed environment. In the above example, if on another data node, value3 = cache1.get(key1) will get the original attribute value in value3, since the deserialize object will always get the original value, unless the new value is put in explicitly by cache1.put(key1, value1).
    In this case, should cache1.get(key1) always return a clone object make more sense?
    Thanks

    You observation is correct. More specifically for cache topologies which include an in-process cache Coherence may return the same object reference for repeated get requests on the same key. I say "may" because for any variety of reasons we may also have to retrieve a fresh copy from a remote cache server. When possible we will return existing objects for performance reasons avoiding costly things like network hops, and de-serialization. Any modifications made to an object returned from the cache will not be made automatically available to other cluster members. Additionally if these modifications are made concurrently with another thread performing a cache.put() on the same value could result in a corrupt cached value if your serialization methods are not thread-safe. Best practice dictates that unless you are sure that you are using a cache topology which does not include an in-process cache that you treat the values returned from the cache as immutable, and instead deep clone() it before making any modifications.
    The distributed-scheme and remote-scheme are the only types of caches which do not include in-process caching, and thus always return "mutation safe" values. The most common in-process cache topology is near-scheme, but others include replicated-scheme, optimistic-scheme, local-scheme, and the programatically created ContinuousQueryCache.
    thanks,
    mark

  • Start a new Coherence cache server

    Hi experts,
    I have an application configured with oracle coherence running on the weblogic server. Can I start a new Coherence cache server from a command prompt so that, this newly created cache server joins the existing cluster already running on the weblogic server. Can you please guide me through this or point to the relevant documentation.
    Thanks for your time.
    Cheers,

    You just need to run...
    java <parameters> -cp <your class path> DefaultCacheServerwhere...
    <parameters> is set to the same set of -D paramters you have given the application inside WebLogic.
    <your class path> is all the jar files in your application, including coherence.jar (but you don't need any ear or web app stuff obviously)
    Presumably you have configured the system properties for your application in WebLogic to set the multicast address (-Dtangosol.coherence.clusteraddress
    and -Dtangosol.coherence.clusterport), cache config (-Dtangosol.coherence.cacheconfig) etc... If you have not then you really should! You basically run DefaultCacheServer with the same parameters.
    When I have used Weblogic and Coherence in the past the usual configurationis to run a number of storage enabled cache server nodes (which is what you are asking about) and then run the WebLogic nodes as storage diabled cluster members. This is much more efficient as it lets the storage enabled node just concentrate on storing data nad the WebLogic node just concentrate on you application.
    JK

  • Handling collections in coherence cache

    hi,
    In a mutithreaded environment, how does coherence cache handles collection like HashMap in a multithreaded environment where the large majority of method calls are read-only, instead of structural changes?
    Are the read calls non-synchronized by coherence? Is there any mechanism to handle the write calls different from the read calls?
    Thanks.
    suvasis

    Hi Suvasis,
    Coherence caches are coherent, and use a minimal (or zero if possible) amount of synchronization for read-access.
    Coherence does support double-checked locking for read-heavy access:
    <tt>
    Object value = cache.get(k);
    if (value == null)
      cache.lock(key, -1);
      try
        value = cache.get(key);
        if (value == null)
          value = {something};
          cache.put(key, value);
      finally
        cache.unlock(key);
    // read-access to value
    Object x = value.getSomeAttribute();
    </tt>
    It should be noted that Coherence does not "observe" objects outside of the Coherence API calls (get/put/lock/unlock/etc). So once you "get" a local object instance from Coherence, Coherence doesn't pay attention to that local object until you explicitly "put" it the modified object back into the cache.
    Jon Purdy
    Tangosol, Inc.

Maybe you are looking for

  • How to make a VR html file autoplay via the Web Content overlay

    Hello, We have created a VR using Object2VR and have loaded the .html file via the Web Content Overlay panel in InDesign CS5.5. We want this VR to play automatically on page load, so we have checked the box 'aut play' in the Web Content overlay panel

  • HP Laserjet 1300 backend failed

    I have a HP laserjet 1300 printer that used to work, and stopped working for no apparent reason.  I hit print for web pagers, documents, etc and get this error:  "backend failed".  My other HP printers work, just not this laser jet.  I've deleted the

  • Insert a splash Screen for a Jbuilder Application

    hi all Does Anybody know how to insert a Spash screen to a Jbuilder application. I am doing my software project on Jbuilder version 8 and I have the Frame1.java as the main java file. can anybody give the code for a splash screen and tell me how to i

  • I need to download a previously purchased movie from iTunes.

    I bought several movies on my iPod and would like to watch them on my iPad 2 now. iTunes insists I buy them again, and I'm mad enough to switch away from apple forever because their tech support is nonexistent. I own about 10k$ worth of products with

  • Error: JBO-26030 in JDev 903

    Hi: I migrated my projects from Jdev 902 to 903. In 902 everything works well but in 903 when i run a JClient Form i get the following error: D:\JDEV90~1\jdk\bin\javaw.exe -ojvm -classpath C:\JDev9i_902\jdev\mywork\Espacio\ProyJClient\classes;C:\JDev