Stanislav Lukyanov created IGNITE-7687:
------------------------------------------

             Summary: SQL SELECT doesn't update TTL for 
Touched/AccessedExpiryPolicy
                 Key: IGNITE-7687
                 URL: https://issues.apache.org/jira/browse/IGNITE-7687
             Project: Ignite
          Issue Type: Bug
          Components: sql
    Affects Versions: 2.5
            Reporter: Stanislav Lukyanov


SQL SELECT queries don't update TTLs when TouchedExpiryPolicy or 
AccessedExpiryPolicy is used (unlike IgniteCache::get which does update the 
TTLs).

Example (modified SqlDmlExample):
========================
    CacheConfiguration<Long, Organization> orgCacheCfg = new 
CacheConfiguration<Long, Organization>(ORG_CACHE)
        .setIndexedTypes(Long.class, Organization.class)
        .setExpiryPolicyFactory(TouchedExpiryPolicy.factoryOf(new 
Duration(TimeUnit.SECONDS, 10)));
    
    IgniteCache<Long, Organization> orgCache = 
ignite.getOrCreateCache(orgCacheCfg);
    
    SqlFieldsQuery qry = new SqlFieldsQuery("insert into Organization (_key, 
id, name) values (?, ?, ?)");
    orgCache.query(qry.setArgs(1L, 1L, "ASF"));
    orgCache.query(qry.setArgs(2L, 2L, "Eclipse"));
    
    SqlFieldsQuery qry1 = new SqlFieldsQuery("select id, name from Organization 
as o");
    for (int i = 0; ;i++) {
        List<List<?>> res = orgCache.query(qry1).getAll();
        print("i = " + i);
        for (Object next : res)
            System.out.println(">>>     " + next);
        U.sleep(5000);
    }
========================
Output:
>>> i = 0
>>>     [1, ASF]
>>>     [2, Eclipse]

>>> i = 1
>>>     [1, ASF]
>>>     [2, Eclipse]

>>> i = 2

>>> i = 3
...



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to