﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - ISDataSource - ISDataSource CacheKeyDependency does not work</title><link>http://www.intersoftsolutions.com/Community/ISDataSource/ISDataSource-CacheKeyDependency-does-not-work/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>ISDataSource CacheKeyDependency does not work</title><link>http://www.intersoftsolutions.com/Community/ISDataSource/ISDataSource-CacheKeyDependency-does-not-work/</link><pubDate>Tue, 08 Sep 2009 12:25:47 GMT</pubDate><dc:creator>technical@intersoftpt.com</dc:creator><category>ISDataSource</category><category>cache</category><category>CacheKeyDependency</category><description>&lt;p&gt;Good news! Our development team has enhanced the &lt;strong&gt;CacheKeyDependency&lt;/strong&gt; feature to work consistently with the behavior found in .NET's ObjectDataSource and SqlDataSource.&lt;/p&gt;
&lt;p&gt;The enhancement will be available in the next build coming later this month. Please note that the enhancement will require update on both Framework and ISDataSource assembly, which will be posted together in the monthly hotfix release.&lt;/p&gt;</description></item><item><title>ISDataSource CacheKeyDependency does not work</title><link>http://www.intersoftsolutions.com/Community/ISDataSource/ISDataSource-CacheKeyDependency-does-not-work/</link><pubDate>Thu, 03 Sep 2009 08:58:27 GMT</pubDate><dc:creator>technical@intersoftpt.com</dc:creator><category>ISDataSource</category><category>cache</category><category>CacheKeyDependency</category><description>&lt;p&gt;Hi Mariusz,&lt;/p&gt;
&lt;p&gt;Thank you for posting such interesting discussion!&lt;/p&gt;
&lt;p&gt;It appears that we implement CacheKeyDependency differently than that in ObjectDataSource. However, after more investigation based on your feedback, our development team will investigate the possibility to enhance the feature to provide more consistent behavior as expected in datasource control.&lt;/p&gt;
&lt;p&gt;I'll keep you updated on this thread when the enhancement becomes available.&lt;/p&gt;</description></item><item><title>ISDataSource CacheKeyDependency does not work</title><link>http://www.intersoftsolutions.com/Community/ISDataSource/ISDataSource-CacheKeyDependency-does-not-work/</link><pubDate>Thu, 03 Sep 2009 06:19:29 GMT</pubDate><dc:creator>mariusz.kopera@gmail.com</dc:creator><category>ISDataSource</category><category>cache</category><category>CacheKeyDependency</category><description>&lt;p&gt;Glenn,&lt;/p&gt;&lt;p&gt;Thanks again. &lt;/p&gt;
&lt;p&gt;Your first and second solution works fine.  &lt;/p&gt;
&lt;p&gt;I know that there is cache collection like I mentioned in my first post . I considered to use your second solution to go through entire cache collection and find this cache keys that containt specific key (e.g. "CacheKey"). But this is some kind &lt;span style="font-family: tahoma; font-size: 12px; "&gt;prosthesis. I am still waiting for answer about CacheKeyDependency or could you please admit that "CacheKeyDependency" doesn't work properly and I should find diffrent way to solve my problem. My next question to someone from support team is "Will&amp;nbsp;it be fixed?".&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="font-size: 15px; font-family: tahoma; "&gt;&lt;span style="font-size: 12px; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="font-size: 15px; font-family: tahoma; "&gt;&lt;span style="font-size: 12px; "&gt;Regards,&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="font-size: 15px; font-family: tahoma; "&gt;&lt;span style="font-size: 12px; "&gt;Mariusz&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="font-size: 15px; font-family: tahoma; "&gt;&lt;span style="font-size: 12px; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="font-size: 15px; font-family: tahoma; "&gt;&lt;span style="font-size: 12px; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;</description></item><item><title>ISDataSource CacheKeyDependency does not work</title><link>http://www.intersoftsolutions.com/Community/ISDataSource/ISDataSource-CacheKeyDependency-does-not-work/</link><pubDate>Thu, 03 Sep 2009 05:49:24 GMT</pubDate><dc:creator>Glayaar</dc:creator><category>ISDataSource</category><category>cache</category><category>CacheKeyDependency</category><description>&lt;p&gt;ISDataSource will generate multiple key in the Cache object for its internal mechanism, just as you reported before. In order to invalidate the data you will need to clear all the keys generated by the ISDataSource in the Cache object.&lt;/p&gt;&lt;p&gt;The idea is to iterate all the Cache object key and delete the key that match the pattern of the key created by the ISDataSource. In the snippet the CacheKeyDependency is &lt;em&gt;"key1"&lt;/em&gt; &lt;/p&gt;&lt;pre&gt;protected void Button1_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;    IDictionaryEnumerator CacheEnum = Cache.GetEnumerator();&lt;br /&gt;    ArrayList keyList = new ArrayList();&lt;br /&gt;    while(CacheEnum.MoveNext())&lt;br /&gt;    {&lt;br /&gt;        if (CacheEnum.Key.ToString().Contains("key1:") || CacheEnum.Key.ToString() == "key1")&lt;br /&gt;        {&lt;br /&gt;            keyList.Add(CacheEnum.Key);&lt;br /&gt;        }   &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    foreach (string key in keyList)&lt;br /&gt;    {&lt;br /&gt;        Cache.Remove(key);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    GridView1.DataBind();&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>ISDataSource CacheKeyDependency does not work</title><link>http://www.intersoftsolutions.com/Community/ISDataSource/ISDataSource-CacheKeyDependency-does-not-work/</link><pubDate>Thu, 03 Sep 2009 04:46:17 GMT</pubDate><dc:creator>mariusz.kopera@gmail.com</dc:creator><category>ISDataSource</category><category>cache</category><category>CacheKeyDependency</category><description>&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Glenn,&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Thank you for you answer, but it isn't so simple. I presented simplest case in my solution. My real scenerio must have posibility to invalidate some cache from different page. Clearing cache suggested by you works only if I am on this page now and ISDataSource1 exists. I am trying to use CacheKeyDependency as it was designed by Microsoft.&amp;nbsp;&lt;span style="font-size: 13px; "&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.objectdatasource.cachekeydependency.aspx" target="_blank"&gt;MSDN cachekeydependency&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;In ma scenario&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;I create cache in global.ascx&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'segoe ui', arial, verdana, tahoma; color: rgb(76, 76, 76); line-height: 18px; white-space: pre; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;Cache.Insert("CacheKey",DateTime.Now);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="line-height: 18px; white-space: pre; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;then I  configure cache for table on &lt;b&gt;Page1.aspx   attachement1.png&lt;/b&gt;.   ISDataSource1 CacheKeyDependency is set to "CacheKey"&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;After that I'm going to &lt;b&gt;Page2.aspx&lt;/b&gt; &amp;nbsp;and changing &amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'segoe ui', arial, verdana, tahoma; color: rgb(76, 76, 76); font-weight: bold; line-height: 18px; white-space: pre; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;cache under "CacheKey"&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="line-height: 18px; white-space: pre; font-size: 9pt; "&gt;&lt;b&gt;&lt;span style="font-size: 9pt; "&gt;        &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: 'lucida sans unicode'; font-weight: normal; line-height: normal; white-space: normal; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'segoe ui', arial, verdana, tahoma; color: rgb(76, 76, 76); line-height: 18px; white-space: pre; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;Cache.Insert("CacheKey",DateTime.Now);  &amp;lt;- Here we have new date than previous one.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="line-height: 18px; white-space: pre; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;Table cache on Page1.aspx should invalidate by itself on first load this page.&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="line-height: 18px; white-space: pre; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="line-height: 18px; white-space: pre; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="line-height: 18px; white-space: pre; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="line-height: 18px; white-space: pre; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="line-height: 18px; white-space: pre; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;Regards,&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="font-size: 15px; color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="font-size: 12px; line-height: 18px; white-space: pre; "&gt;Mariusz&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="line-height: 18px; white-space: pre; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="font-size: 15px; color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="line-height: 18px; white-space: pre; font-size: 8pt; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;</description></item><item><title>ISDataSource CacheKeyDependency does not work</title><link>http://www.intersoftsolutions.com/Community/ISDataSource/ISDataSource-CacheKeyDependency-does-not-work/</link><pubDate>Thu, 03 Sep 2009 03:30:20 GMT</pubDate><dc:creator>Glayaar</dc:creator><category>ISDataSource</category><category>cache</category><category>CacheKeyDependency</category><description>&lt;p&gt;ISDataSource has provided a function to clear the table cache, using the ClearCache function of the ISDataSource table. We could demonstrate this function by modifying the UsingCacheKeyDependency.aspx ISdataSource sample. Please add an ASP.NET button with a click event handler:&lt;/p&gt;&lt;pre&gt;protected void Button1_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;    ISDataSource1.Tables.GetNamedItem("TimedDataKeyDependency").ClearCache();&lt;br /&gt;    GridView1.DataBind();&lt;br /&gt;}&lt;/pre&gt;&lt;p&gt;A button click will refetch the data because the cache has already been cleared &lt;br /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>ISDataSource CacheKeyDependency does not work</title><link>http://www.intersoftsolutions.com/Community/ISDataSource/ISDataSource-CacheKeyDependency-does-not-work/</link><pubDate>Wed, 02 Sep 2009 11:15:21 GMT</pubDate><dc:creator>mariusz.kopera@gmail.com</dc:creator><category>ISDataSource</category><category>cache</category><category>CacheKeyDependency</category><description>&lt;p&gt;I have defined ISDataSource table with &lt;span style="font-family: 'segoe ui', arial, verdana, tahoma; color: rgb(76, 76, 76); white-space: pre; "&gt;CacheKeyDependency&amp;nbsp; &lt;b&gt;attachement1.png&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="white-space: pre; "&gt;On page load I created cache &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="white-space: pre; "&gt;    Cache.Insert("CacheKey",DateTime.Now);&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="white-space: pre; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="white-space: pre; "&gt;ISDataSource. CacheKeyDependency is set to "CacheKey"&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="white-space: pre; "&gt;&lt;b&gt;After changing cache under "CacheKey",  ISDataSource cache should be invalidated, but it didn't happen.&lt;/b&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="white-space: pre; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="white-space: pre; "&gt;I've noticed that cache collection contain 3 positions connected with this case&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="white-space: pre; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;p&gt;Key=CacheKey, &amp;nbsp; Value=02-09-2009 17:05:23&amp;nbsp;&lt;/p&gt;&lt;p&gt;Key=uCacheKey:PODMIOT:3600:Sliding:Hahs2TableAdapters.PODMIOTTableAdapter:GetData, &amp;nbsp; Value=2&amp;nbsp;&lt;/p&gt;&lt;p&gt;Key=uCacheKey:PODMIOT:3600:Sliding:Hahs2TableAdapters.PODMIOTTableAdapter:GetData:0:0, &amp;nbsp; Value=PODMIOT&amp;nbsp;&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="white-space: pre; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="white-space: pre; "&gt;This works fine if I use sqlDataSource or ObjectDataSource instead of ISDataSource.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="white-space: pre; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="white-space: pre; "&gt;Please, Could you send me some example how to use ISDataSource CacheKeyDependency in this case.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="white-space: pre; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="white-space: pre; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="white-space: pre; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(76, 76, 76); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="white-space: pre; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;</description></item></channel></rss>