souser
souser

Reputation: 798

How to clear a specific cache region : ehcache

I have a ehcache configuration like the below :

<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<cache
name="reg1"
maxElementsInMemory="100000"
eternal="false"
overflowToDisk="true"
timeToLiveSeconds="1">
</cache>
<cache
name="reg2"
maxElementsInMemory="1000000"
eternal="false"
overflowToDisk="true"
timeToLiveSeconds="100"/>
</ehcache>

I am unable to figure out how I can clear just "reg1". I have seen a method to clear all but not a specific region. Anyone who has figured out how to do this, please share.

Thanks

Upvotes: 0

Views: 2755

Answers (1)

souser
souser

Reputation: 798

From the Ehcache documentation :

http://ehcache.org/apidocs/2.4.4/net/sf/ehcache/Cache.html#removeAll()

Removes all cached items.

Upvotes: 1

Related Questions