
591
DEVELOPING
COLDFUSION 9 APPLICATIONS
ColdFusion ORM
Las
t
upda
te
d 8/5/2010
<ehcache>
<diskStore path="java.io.tmpdir"/>
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU"
/>
<cache name="Artist"
maxElementsInMemory="20"
eternal="true"
overflowToDisk="false"
/>
</ehcache>
Modifications to ehcache.xml in ColdFusion 9.0.1
ehCache.xml includes the following configuration properties:
•
diskSpoolBufferSizeMB
: Size to allocate the DiskStore for a spool buffer.
The default size is 30 MB. Each spool buffer is used only by its cache.
Turning on trace-level logging shows if backup for cache created/updated using
action="put"
occurs in the
diskstore.
•
clearOnFlush
: Determines if the MemoryStore must be cleared when the cache is flushed. By default, the
MemoryStore is cleared.
•
diskExpiryThreadIntervalSeconds
: The number of seconds between runs of the disk expiry thread. The default
value is
120
seconds.
Note:
The functions
cacheGetProperties
and
cacheSetProperties
can be used to get/set these properties.
Use secondary cache
To use secondary cache, you must configure the following settings in the application:
•
ormsettings.secondarycacheenabled
This setting defines whether the secondary cache would be used by the application. By default, this is set to false.
•
ormsettings.Cacheprovider
This setting defines the cache provider that needs to be used for secondary cache. This defaults to EHCache. The
other values for this setting are JBossCache, OSCache, SwarmCache and Hashtable. You can also specify the fully
qualified class name of the cache provider.
•
ormsettings.cacheconfig
This setting defines the configuration file required by the secondary cache provider. For example, EHCache
requires
EHCache.xml
that defines the configuration settings for the secondary cache. Specify the path to the XML
file in this setting. If this setting is not defined, cache provider uses its default configuration.