[ 
https://issues.apache.org/jira/browse/GEODE-3809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16200684#comment-16200684
 ] 

Jason Huynh commented on GEODE-3809:
------------------------------------

It looks like the entry is getting it's last access time updated in the local 
client cache.  That is why the gets continue to work.  However the server does 
not have its last access time updated and then expires the entry.  That is why 
the query is no longer returning a value but the client still is able to do a 
get.

If you change the client cache to PROXY instead of LOCAL, the query 3 will now 
return the correct value because the gets would have updated the servers last 
access time for that entry.

If you go back to the LOCAL configuration (and let's ignore queries at this 
time), you will still have the scenario where you do gets on the client cache 
and the server doesn't get accessed.  The server will expire the entry same as 
before, but if you register interest from the client, the client would at least 
receive the destroy and the local gets would now return null.

Queries, currently, do not update the last access time for the entry.  I've 
opened GEODE-3811: Queries should update the access time of an entry.


> Invalid OQL result to region with entry-idle-time setting
> ---------------------------------------------------------
>
>                 Key: GEODE-3809
>                 URL: https://issues.apache.org/jira/browse/GEODE-3809
>             Project: Geode
>          Issue Type: Bug
>          Components: querying
>            Reporter: Masaki Yamakawa
>
> I am setting the expiration of entry-idle-time to Region. Despite periodic 
> access to the region, I discovered an event that data can not be get with OQL 
> after the time set by entry-idle-time has elapsed. I am using Geode in the 
> production, so I want you to solve this problem as soon as possible.
> The cache.xml of the server is as follows:
> {code:xml}
> <cache>
>   <cache-server port="7777" />
>   <region name="Data" refid="PARTITION">
>     <region-attributes>
>       <entry-idle-time>
>         <expiration-attributes timeout="10" action="destroy" />
>       </entry-idle-time>
>     </region-attributes>
>   </region>
> </cache>
> {code}
> The source code of the client is as follows:
> {code:java}
> private static final Integer KEY = 1;
> public static void main(String[] args) throws Exception {
>       Properties props = new Properties();
>       props.setProperty("cache-xml-file", "clientcache.xml");
>       ClientCacheFactory factory = new ClientCacheFactory(props);
>       ClientCache cache = factory.create();
>       Region<Integer, String> region = cache.getRegion("Data");
>       region.put(KEY, "InitialValue");
>       Thread.sleep(7000);
>       System.out.println("Get Result1=" + region.get(1));
>       Pool pool = PoolManager.find("ClientPool");
>       Query query = pool.getQueryService().newQuery("select k from 
> /Data.keySet k");
>       // Normal OQL result
>       SelectResults result = SelectResults.class.cast(query.execute());
>       System.out.println("Get Result2=" + region.get(1));
>       System.out.println("Query Result2=" + result.size() + ", value=" + 
> result.iterator().next());
>       Thread.sleep(5000);
>       // Invalid OQL result!!!
>       result = SelectResults.class.cast(query.execute());
>       System.out.println("Get Result3=" + region.get(1));
>       System.out.println("Query Result3=" + result.size() + ", value=" + 
> (result.isEmpty() ? null : result.iterator().next()));
>       System.out.println("Get Result4=" + region.get(1));
>       cache.close();
>       System.exit(0);
> }
> {code}
> {code:xml}
> <client-cache>
>   <pool name="ClientPool" subscription-enabled="true">
>     <server host="localhost" port="7777" />
>   </pool>
>   <region name="Data">
>     <region-attributes refid="LOCAL" pool-name="ClientPool" />
>   </region>
> </client-cache>
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to