[
https://issues.jboss.org/browse/ISPN-3407?page=com.atlassian.jira.plugin....
]
Galder Zamarreño commented on ISPN-3407:
----------------------------------------
Ever since ISPN-761 was fixed, size() takes into account entries that are stored in the
cache store as well. So, this is working as expected.
Entry passivation doesn't work according to eviction strategy
-------------------------------------------------------------
Key: ISPN-3407
URL:
https://issues.jboss.org/browse/ISPN-3407
Project: Infinispan
Issue Type: Bug
Components: Eviction
Affects Versions: 5.3.0.Final
Reporter: Vitalii Chepeliuk
Assignee: Galder Zamarreño
Priority: Critical
Labels: 620
Fix For: 6.0.0.Final
{code:title=Test.java|borderStyle=solid}
GlobalConfiguration globalConf = new
GlobalConfigurationBuilder().nonClusteredDefault().build();
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.clustering().cacheMode(CacheMode.LOCAL)
.loaders().passivation(true).preload(false).shared(false)
.addLoader(JdbcStringBasedCacheStoreConfigurationBuilder.class).fetchPersistentState(false).purgeOnStartup(false)
.table()
.databaseType(DatabaseType.MYSQL)
.dropOnExit(false)
.createOnStart(true)
.tableNamePrefix("ISPN6Alpha2_STRING")
.idColumnName("ID").idColumnType("VARCHAR(255)")
.dataColumnName("DATA").dataColumnType("VARBINARY(1000)")
.timestampColumnName("TIMESTAMP").timestampColumnType("BIGINT")
.connectionPool()
.connectionUrl()
.username("username")
.password("password")
.driverClass("com.mysql.jdbc.Driver")
.eviction().strategy(EvictionStrategy.LRU).maxEntries(2);
Configuration localConf = builder.build();
DefaultCacheManager defCacheManager = new DefaultCacheManager(globalConf,
localConf, true);
Cache<String, String> cache = defCacheManager.getCache();
cache.put("k1", "v1");
cache.put("k2", "v2");
//not yet in store (eviction.max-entries=2, LRU)
cache.put("k3", "v3");
assertEquals("v3", cache.get("k3"));
//now k1 evicted and stored in store
assertEquals(2, cache.size()); <<< only 2 entries should remain in
cache, k1 should be passivated and removed. But doesn't work!
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira