<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: JavaDoc of IDataCach with lifetime parameter</title><link>https://answers.axonivy.com/questions/2440/javadoc-of-idatacach-with-lifetime-parameter</link><description>&lt;p&gt;Hi Ivyteam, &lt;/p&gt;
&lt;p&gt;According to the javadoc:
&lt;img alt="alt text" src="http://answers.axonivy.com/upfiles/IDataCache_NC0V36q.PNG"&gt;&lt;/p&gt;
&lt;p&gt;I try to store the value by using IDatacach with &lt;strong&gt;lifetime's value is 0&lt;/strong&gt;. Then I expected that it will be expired after 1 minute. But unfortunately, &lt;strong&gt;it seems to be infinite time&lt;/strong&gt; in IvyCach, even I call it again after 5 minutes.&lt;/p&gt;
&lt;p&gt;After Hau Tran's TA guy dig into the ivy source code. He found that, there is one condition to check like that &lt;strong&gt;&lt;em&gt;if (lifetime &amp;gt; 0)&lt;/em&gt;&lt;/strong&gt; in the method  processGroup and processEntry of DataCacheInvalidationJob class.&lt;/p&gt;
&lt;p&gt;Now, you see that the java doc make me consufed about the lifetime's explanation.&lt;/p&gt;
&lt;p&gt;I am looking forward to hearing any ideas from you :)&lt;/p&gt;
&lt;p&gt;Vuong Vu&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/2440/javadoc-of-idatacach-with-lifetime-parameter" rel="self"></atom:link><language>en</language><lastBuildDate>Fri, 17 Feb 2017 14:35:41 -0500</lastBuildDate><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/2440/javadoc-of-idatacach-with-lifetime-parameter/2453</link><description>&lt;p&gt;To expire the cache after one minute I would pass '60' as lifetime (in seconds). &lt;/p&gt;
&lt;p&gt;However the fact that the value zero (0) behaves like -1 is for legacy reasons. For a long time the cache was accidentally wrong implemented (lifetime &amp;gt; 0). So many implementations in the field already rely on the fact that 0 is also cached forever. And we'll not change the implementation to keep these old projects happy.&lt;/p&gt;
&lt;p&gt;In my opinion it also makes no sense to use a cache which is only valid for less than a second.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Fri, 17 Feb 2017 14:35:41 -0500</pubDate><guid>https://answers.axonivy.com/questions/2440/javadoc-of-idatacach-with-lifetime-parameter/2453</guid></item></channel></rss>