You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by hwaastad <he...@waastad.org> on 2016/12/15 13:06:58 UTC

JCS beta-2 bug

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.

Re: JCS beta-2 bug

Posted by Helge Waastad <he...@waastad.org>.
I never doubted that an issue would be solved quickly when youre saying so 😃
Thx for youre commitment.
Please help release 2.0 soon 😃

/hw

Sendt fra min iPhone

> Den 15. des. 2016 kl. 16.45 skrev Romain Manni-Bucau <rm...@gmail.com>:
> 
> redeployed a snapshot (2.0-SNAPSHOT) if you want to have a try
> 
> 
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <https://blog-rmannibucau.rhcloud.com> | Old Blog
> <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
> <https://javaeefactory-rmannibucau.rhcloud.com>
> 
> 2016-12-15 16:09 GMT+01:00 Romain Manni-Bucau <rm...@gmail.com>:
> 
>> opened https://issues.apache.org/jira/browse/JCS-169. normally fixed very
>> soon
>> 
>> 
>> Romain Manni-Bucau
>> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
>> <https://blog-rmannibucau.rhcloud.com> | Old Blog
>> <http://rmannibucau.wordpress.com> | Github
>> <https://github.com/rmannibucau> | LinkedIn
>> <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
>> <https://javaeefactory-rmannibucau.rhcloud.com>
>> 
>> 2016-12-15 15:45 GMT+01:00 hwaastad <he...@waastad.org>:
>> 
>>> HI,
>>> did testing with higher values but increasing time does not change the
>>> issue.
>>> 
>>> /hw
>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> View this message in context: http://tomee-openejb.979440.n4
>>> .nabble.com/JCS-beta-2-bug-tp4680745p4680750.html
>>> Sent from the TomEE Users mailing list archive at Nabble.com.
>>> 
>> 
>> 


Re: JCS beta-2 bug

Posted by Romain Manni-Bucau <rm...@gmail.com>.
redeployed a snapshot (2.0-SNAPSHOT) if you want to have a try


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-12-15 16:09 GMT+01:00 Romain Manni-Bucau <rm...@gmail.com>:

> opened https://issues.apache.org/jira/browse/JCS-169. normally fixed very
> soon
>
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <https://blog-rmannibucau.rhcloud.com> | Old Blog
> <http://rmannibucau.wordpress.com> | Github
> <https://github.com/rmannibucau> | LinkedIn
> <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
> <https://javaeefactory-rmannibucau.rhcloud.com>
>
> 2016-12-15 15:45 GMT+01:00 hwaastad <he...@waastad.org>:
>
>> HI,
>> did testing with higher values but increasing time does not change the
>> issue.
>>
>> /hw
>>
>>
>>
>>
>>
>> --
>> View this message in context: http://tomee-openejb.979440.n4
>> .nabble.com/JCS-beta-2-bug-tp4680745p4680750.html
>> Sent from the TomEE Users mailing list archive at Nabble.com.
>>
>
>

Re: JCS beta-2 bug

Posted by Romain Manni-Bucau <rm...@gmail.com>.
opened https://issues.apache.org/jira/browse/JCS-169. normally fixed very
soon


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-12-15 15:45 GMT+01:00 hwaastad <he...@waastad.org>:

> HI,
> did testing with higher values but increasing time does not change the
> issue.
>
> /hw
>
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/JCS-beta-2-bug-tp4680745p4680750.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: JCS beta-2 bug

Posted by hwaastad <he...@waastad.org>.
HI,
did testing with higher values but increasing time does not change the
issue.

/hw





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

Re: JCS beta-2 bug

Posted by Helge Waastad <he...@waastad.org>.
Hi,
I will.....but there is a reason for me finding this issue :-)

I'll update when tested

/hw

to., 15.12.2016 kl. 14.31 +0100, skrev Romain Manni-Bucau:
> Before digging can you check with a higher value? ~50ms the jvm is
> not
> precise enough depending the os and api. Try around 300ms or 1s
> maybe.
> 
> Le 15 d�c. 2016 14:21, "hwaastad" <he...@waastad.org> a �crit :
> 
> > 
> > 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.factor
> > yOf(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.
> > 

Re: JCS beta-2 bug

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Before digging can you check with a higher value? ~50ms the jvm is not
precise enough depending the os and api. Try around 300ms or 1s maybe.

Le 15 déc. 2016 14:21, "hwaastad" <he...@waastad.org> a écrit :

> 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.
>