I am getting "Cache has been closed" exception when accessing Ignite Cache for querying. What I'm doing is simply,
CacheConfiguration cfg = new CacheConfiguration();
cacheConfiguration.setCacheMode(CacheMode.REPLICATED);
cacheConfiguration.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT); cacheConfiguration.setWriteSynchronizationMode(CacheWriteSynchronizationMode.PRIMARY_SYNC);
IgniteCache cache = ignite.getOrCreateCache(cfg);
After initializing this, in other place in my code I am calling cache.get("key")
; But it's throwing exception.
Cache variable is member of some class's object. Why can't the cache be kept open till it is closed manually.
I AM NOT CLOSING IT ANYWHERE