You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Vladimir Ozerov (JIRA)" <ji...@apache.org> on 2018/08/14 08:18:00 UTC
[jira] [Commented] (IGNITE-7687) SQL SELECT doesn't update TTL for
Touched/AccessedExpiryPolicy
[ https://issues.apache.org/jira/browse/IGNITE-7687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16579419#comment-16579419 ]
Vladimir Ozerov commented on IGNITE-7687:
-----------------------------------------
[~satendra], hi. Unfortunately, I do not see any workarounds at the moment.
> 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
> Priority: Major
>
> 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)