Skip to content

Instantly share code, notes, and snippets.

@juliojsb
Created March 18, 2016 20:16
Show Gist options
  • Save juliojsb/c8975382dd6b62ec5f5a to your computer and use it in GitHub Desktop.
Save juliojsb/c8975382dd6b62ec5f5a to your computer and use it in GitHub Desktop.
Optimization of Jboss applications. Enable second level hibernate cache in WEB-INF/classes/persistence.xml of an application
<shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
<properties>
<property name="hibernate.cache.infinispan.statistics" value="true"/>
<property name="hibernate.cache.use_second_level_cache" value="true"/>
<property name="hibernate.cache.use_minimal_puts" value="true"/>
<property name="hibernate.cache.infinispan.entity.eviction.strategy" value= "LRU"/>
<property name="hibernate.cache.infinispan.entity.eviction.wake_up_interval" value= "2000"/>
<property name="hibernate.cache.infinispan.entity.eviction.max_entries" value= "6000"/>
<property name="hibernate.cache.infinispan.entity.expiration.lifespan" value= "60000"/>
<property name="hibernate.cache.infinispan.entity.expiration.max_idle" value= "30000"/>
</properties>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment