hazelcast / hazelcast-hibernate

A distributed second-level cache for Hibernate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HazelcastLocalCacheRegionFactory / map config / eviction size="0" (turn off specific cache via hazelcast config not possible)

qeepcologne opened this issue · comments

(summary of hazelcast/hazelcast#18158)

I am using hazelcast-hibernate53:2.2.0 with HazelcastLocalCacheRegionFactory and set config like that:

<map name="de.k2interactive.qeep.users.db.PluginDataDto">
    <eviction size="0" />
</map>

I want to turn off the cache only for these specific dto and only in that hazelcast config,
use_second_level_cache=false or removing the cache annotation is also not the solution
(we we use the same dto class in a different contexts with multiple datasources)

@enozcan told me that eviction-size=0 ends up with Integer.MAX_VALUE.
This is not documented in any way in EvictionConfig.

Is it possible to change that and use another magic value (-1?) for unlimited size?
Or at least document this special behaviour in the javadocs?

If there is another option to turn off specific cache via hazelcast config, please let me know.