Details
-
Bug
-
Resolution: Won't Do
-
Critical
-
None
-
5.3.0.Final
Description
Test.java
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!