ehCache is evicting the entries even though eternal is set to true

63 Views Asked by At

. The cache objects values are hibernate entities bear in mind it had stored in level 2 cache as well. When we see the Ehcache statistics , it is always twice the no of objects . We thought we set eternal to true to our cache , but it seems keys present but value is disappeared , we suspect the entities are evicted from hibernate l2 cache . It’s really so difficult to re produce

1

There are 1 best solutions below

0
On

The problem is identified .

Our app is using hibernate query level cache and second level cache also. On the startup , we have a configuration ( which is cached in query level and second level) cached into our own cache ( using hCache). When hibernate executes a native query which is a commit for one of the entity , hibernate is invalidating the second level cache for most of the entities .