Caching
Improve your database performance with secondary caching in Hibernate ORM.
Secondary Cache
this.ormSettings = {
secondaryCacheEnabled : true
};this.ormSettings = {
secondaryCacheEnabled: true,
cacheConfig : "./config/ehcache.xml"
};<?xml version="1.0" encoding="UTF-8"?>
<ehcache
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="true" name="default">
<diskStore path="java.io.tmpdir"/>
<defaultCache
maxElementsInMemory="10000" eternal="false"
timeToIdleSeconds="120" timeToLiveSeconds="120"
maxElementsOnDisk="10000000" diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU">
<persistence strategy="localTempSwap"/>
</defaultCache>
<cache
name="Autos"
maxElementsInMemory="20"
overflowToDisk="false"
eternal="true">
</cache>
</ehcache>Configure Each Entity Cache
Alternate Cache Providers Are Unsupported
Last updated
Was this helpful?