I use ehcache in webapp, versions of which are deployed in parallel on a Tomcat instance. This is a convenient way to deploy new versions without stopping the application.
However, I have a problem with this path: even if I give the cache and disks different names, depending on the versions of webapp, the caches all stop when they stop alone .
My config:
<?xml version="1.0" encoding="UTF-8"?> <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd" name="mywebapp-${project.version}_build_${buildNumber}"> <defaultCache maxElementsInMemory="1000" maxElementsOnDisk="10000" eternal="false" timeToLiveSeconds="300" timeToIdleSeconds="300" overflowToDisk="true" diskPersistent="false" memoryStoreEvictionPolicy="LRU" statistics="true" /> <cache maxElementsInMemory="1000" maxElementsOnDisk="10000" name="org.hibernate.cache.internal.StandardQueryCache" eternal="false" timeToLiveSeconds="300" timeToIdleSeconds="300" overflowToDisk="true" diskPersistent="false" statistics="true"/> <cache name="org.hibernate.cache.spi.UpdateTimestampsCache" maxElementsInMemory="10000" maxElementsOnDisk="100000" timeToLiveSeconds="300" timeToIdleSeconds="300" eternal="false" overflowToDisk="true" diskPersistent="false" statistics="true"/> <cache name="query.Presences" maxElementsInMemory="100" maxElementsOnDisk="1000" eternal="false" timeToLiveSeconds="300" timeToIdleSeconds="300" overflowToDisk="true" diskPersistent="false" statistics="true"/> <diskStore path="java.io.tmpdir/mywebapp-${project.version}_build_${buildNumber}"/> </ehcache>
${project.version} and ${buildNumber}
replaced with maven during the build process.
Does anyone know how to avoid this unwanted behavior?
I am using ehcache-core-2.4.3 and hibernate-ehcache-4.3.8.
java tomcat ehcache
Ludovic pΓ©net
source share