ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aosmakoff <alex.osmak...@macquarie.com>
Subject Cannot recreate cache after cache.destroy()
Date Thu, 25 Aug 2016 06:18:52 GMT
Our use case includes clearing the cache at the end of the day and
repopulating it with new content. With a size of the cache in 1.5M records
cache.clear() works extremely slowly and we use cache.destroy(), creating a
new cache and populating it with a new content. As this works as long as all
the cache content is in memory, in case of having an EvictionPolicy defined
for the cache that specifies sizeMax and the cache content exceeds this
size, any attempt of repopulating the new cache fails with
CachePartialUpdateException: Failed to update keys

//Below is the unit test: 
		IgniteCache<WorkspaceItemKey, WorkspaceItem> cache =
		WorkspaceDao workspaceDao = new WorkspaceDaoImpl(cache);
		Long workspaceId = 1L;
		List<AbstractAuditable&lt;Long>> objects = createTestObjects(100);
		workspaceDao.insertItems(workspaceId, objects); //uses cache.putAll();
		CacheConfiguration cacheCfg = new
		cache = null;
		try {
			cache = igniteNode.getOrCreateCache(cacheCfg);
			System.out.println("Closed=" + cache.isClosed());
			workspaceDao = new WorkspaceDaoImpl(cache);
			workspaceDao.insertItems(workspaceId, objects); //uses cache.putAll();
		} catch (Exception e) {
			throw e;
//Cache configuration:
                <bean parent="agg-cache">
                    <property name="name" value="workspace"/>
                    <property name="indexedTypes">
                    <property name="evictionPolicy">
                            <property name="maxSize" value="100"/>

View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Cannot-recreate-cache-after-cache-destroy-tp7291.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

View raw message