Hi Romain,
I'll take my chance asking you since you were the one to solve earlier JCS
issue :-)
(and I discovered this issue using tomee :-) )

https://github.com/hwaastad/JcsTest.git (develop)

when using AccessedExpiryPolicy this will fail using beta-2 while using
beta-1 it's ok:

cachingProvider = Caching.getCachingProvider();
        cacheManager =
cachingProvider.getCacheManager(cachingProvider.getDefaultURI(),
Thread.currentThread().getContextClassLoader(),
cachingProvider.getDefaultProperties());
        cacheManager.createCache(
                cacheName,
                new MutableConfiguration<Integer, Integer>()
                .setStoreByValue(false)
                .setStatisticsEnabled(true)
                .setManagementEnabled(true)
                .setTypes(Integer.class, Integer.class)
                .setExpiryPolicyFactory(AccessedExpiryPolicy.factoryOf(new
Duration(TimeUnit.MILLISECONDS, 10))));

@Test
    public void testTwo() throws Exception {
        cache = cacheManager.getCache(cacheName, Integer.class,
Integer.class);
        cache.put(name, value);
        cache.get(name);
        Thread.sleep(12);
        assertFalse(cache.containsKey(name));
        cache.put(name, value);
        assertTrue(cache.containsKey(name));
    }


/hw





--
View this message in context: 
http://tomee-openejb.979440.n4.nabble.com/JCS-beta-2-bug-tp4680745.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Reply via email to