Quantcast

Cache Configuration

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Cache Configuration

wavyx
Hi, I'm trying to configure hibernate cache so it can be shared among 2 grails applications relying on the data model. The applications use the core-plugin to share the domain. So far, I looked on the mailing list and stack overflow and found this: conf/DataSource.groovy
hibernate {
    cache.use_second_level_cache = true
    cache.use_query_cache = true
    cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
}
conf/ehcache.xml
<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="ehcache.xsd">
    <diskStore path="java.io.tmpdir"/>
    <cacheManagerEventListenerFactory class="" properties=""/>

    <defaultCache maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true"
                  diskSpoolBufferSizeMB="30" maxElementsOnDisk="10000000" diskPersistent="false" diskExpiryThreadIntervalSeconds="120"
                  memoryStoreEvictionPolicy="LRU"/>

    <cache name="org.hibernate.cache.UpdateTimestampsCache"
           maxElementsInMemory="10000"
           timeToIdleSeconds="300"
            />
    <cache name="org.hibernate.cache.StandardQueryCache"
           maxElementsInMemory="10000"
           timeToIdleSeconds="300"
            />
</ehcache>
So I would like to know: 1. Is this the right way to configure cache for my goal (2 applications sharing the same datamodel) 2. I still have the following warning "ehcache.CacheManager Creating a new instance of CacheManager using the diskStorePath "/var/folders/f3/by4v1jbs2gbgf3c9pm46vzph0000gn/T/" which is already used by an existing CacheManager." Any help appreciated ;) Eric PS: http://www.ehcache.org/documentation/recipes/grails seems a bit outdated and uses an unrecognized parameter "maxEntriesLocalHeap"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Cache Configuration

wavyx
bump!

anyone with tips or example on how to properly configure caching with multiple applications ?

Thanks,
Eric
Loading...