neo007
neo007

Reputation: 27

Hazelcast IMap - How to clear all the elements on loadAll(true)

My cache will have elements which might not be in sync DB.

For example, In some use case i used set/putTransient in IMap, so that the element will only be in the cache.

IMap.loadAll(true) doesn't clear those unsynced elements from cache.

Advise please...

update: My reload command

@JMXMethod
    public void reload(){
        log.info("Reloading Cache - [{}] ... ", cachename());
            cache().loadAll(true);  
    }

Upvotes: 0

Views: 2448

Answers (1)

tom.bujok
tom.bujok

Reputation: 1642

Just invoke map.clear() and then map.loadAll(true)

Upvotes: 1

Related Questions