hazelcast-hibernate icon indicating copy to clipboard operation
hazelcast-hibernate copied to clipboard

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

Open qeepcologne opened this issue 4 years ago • 0 comments

(summary of https://github.com/hazelcast/hazelcast/issues/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.

qeepcologne avatar Feb 12 '21 13:02 qeepcologne