PRODUCTS AND SERVICES INDUSTRIES SUPPORT PARTNERS COMMUNITIES ABOUT
   
  Label: faq-code-examples

All content with label faq-code-examples.
Related Labels: review , expiry , namedcache , javabean , synchronize , coherence-cache-config , cluster , backing-map , deployment , cachestore , extend , hibernate , expiration , mutex , troubleshooting , serialization , cache , size , jmx , more »

How do I control the expiry of a cached object by type? (Coherence FAQ)
attached example AutoExpiryLocalCache.java demonstrates the "different object type, different expiry length" implementation. The example configuration exampleautoexpirylocalcache.xml shows String objects being cached for 3 minutes and Integer objects being cached for 10. To use a default expiry, make ...
How do I create a cluster-wide named mutex? (Coherence FAQ)
create a clusterwide, named mutex, simply lock a key in a cache with an infinite wait time. Note that a key can be locked even though the key does not actually exist in the cache. This example implements a nonrecursive mutex. String sMutexName = "myNamedMutex ...
How do I ensure that a put populates a Near Cache? (Coherence FAQ)
When performing a {{put}} on a near cache, the item is placed in the backing map (back cache) but it might not be placed in the near cache (front cache.) This can be verified by observing JMX statistics on the cache. In order to maintain cache coherency, Coherence near caches ...
How do I implement a Clustered Singleton? (Coherence FAQ)
following code example demonstrates how to implement a clustered singleton. import com.tangosol.net.CacheFactory; import com.tangosol.net.NamedCache; / Singleton using cache to back it. (Commented out code is from a singleJVM traditional singleton pattern. New code supports stateless session EJB ...
How do I integrate Coherence and Hibernate? (Coherence FAQ)
Hibernate and Coherence can be used together in several combinations. This document discusses the various options, including when each one is appropriate, along with usage instructions. These options include using Coherence as a Hibernate plugin and using Hibernate as a Coherence plugin via ...
How do I limit a cache size by bytes instead of by the entry count? (Coherence FAQ)
partitioned cache, use the attached cache extension MemoryLimitedCache.java which measures its units in bytes. Configure the {{highunits}} to be in bytes, as shown below. Be sure to specify the class of the cache extension, too. <localscheme> <schemename>bytelimited</schemename> <classname>com.tangosol.examples.coherence.MemoryLimitedCache</classname ...
Where can I get an advanced example of managing Coherence via JMX? (Coherence FAQ)
Coherence Example JMX Web Console Attached to this section jmxconsole.jar is an example Coherence JMX web console that illustrates viewing and manipulating Coherence MBeans via JMX APIs. Simply expand the attached JAR file and read the {{README.txt}} file ...