So I finally got down to the cause of the problem. This is the default ehcache configuration for ehcache 2.5:
As you can see, there is no disk persistence. This is the default configuration for ehcache 2.10 (from ehcache.xml)
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. |