Michał S (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *commented* on HHH-14544 (
https://hibernate.atlassian.net/browse/HHH-14544?atlOrigin=eyJpIjoiMGY4OG...
)
Re: Performance degradation observed with Hibernate 5.4.23 updating timestamps cache when
a cacheable hint isn't specified (
https://hibernate.atlassian.net/browse/HHH-14544?atlOrigin=eyJpIjoiMGY4OG...
)
So I finally got down to the cause of the problem.
This is the default ehcache configuration for ehcache 2.5:
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="600"
timeToLiveSeconds="600"
overflowToDisk="false"
diskPersistent="false"
memoryStoreEvictionPolicy="LRU"
/>
As you can see, there is no disk persistence.
This is the default configuration for ehcache 2.10 (from ehcache.xml)
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
maxElementsOnDisk="10000000"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU">
<persistence strategy="localTempSwap"/>
</defaultCache>
As you can see, they have enabled disk persistence by default - and this is the crux of
the problem, as hibernate-ehcache-5.x depends on ehcache 10. So if you use
hibernate-ehcache in Hibernate 5.x with default ehcache settings, it will cause the
performance issues described in this bug report. This wasn’t the case in Hibernate 3.x
from which we upgraded.
Of course, as Christian noted, there are warnings, it’s just before (Hibernate 3.x) there
was no problem in spite of them.
I think it would be good to at least warn the users of this behavior in the docs - In
Hibernate 3.x you could use ehcache with default settings, in 5.x it’s a mistake.
Thanks again Christian for good pointers.
(
https://hibernate.atlassian.net/browse/HHH-14544#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-14544#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100207- sha1:866f7d8 )