<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Selectively Remove queries from QueryCache</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2012 : Selectively Remove queries from QueryCache</description>
  <pubDate>Fri, 10 Apr 2026 20:58:17 -700</pubDate>
  <lastBuildDate>Wed, 03 Apr 2013 23:49:20 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=4080</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Selectively Remove queries from QueryCache : Hey mgoodThanks for your suggestions....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4080&amp;PID=16172#16172</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1754" rel="nofollow">myr_zero</a><br /><strong>Subject:</strong> 4080<br /><strong>Posted:</strong> 03-Apr-2013 at 11:49pm<br /><br />Hey mgood<div><br></div><div>Thanks for your suggestions. That's a very nice documentation there.</div><div><br></div><div>In my case the whole idea behind using a common EntityManager for the application is "better performance".</div><div><br></div><div>When the same page is revisited, we don't want to load all the data again from database. If we make use of cache, then we save lot of time.</div><div><br></div><div>But in other way, we don't want to keep the outdated entities in cache. It is possible that some thing might have been updated in database from some other client. So at certain intervals we want to remove SPECIFIC(not all) entities from cache, so that we get latest to show when queried for. And also we don't want to occupy more memory with more data. That is the other reason we want to clear some entities at regular intervals.</div><div><br></div><div>Using a different entity manager for each unit of code won't give the advantage of loading from cache when it is revisited. If all separate EntityManagers are made to persist for the life time of application then again comes the problem with memory consumption.</div><div><br></div><div>So if QueryCache.Remove is working properly or&nbsp;<span style=": rgb251, 251, 253; line-height: normal;">RemoveEntity method automatically handles removing of only related queries from query cache, then it would solve problem of all developers who want to take care memory.</span></div><div><span style=": rgb251, 251, 253; line-height: normal;"><br></span></div><div><span style=": rgb251, 251, 253; line-height: normal;"><br></span></div><div><span style=": rgb251, 251, 253; line-height: normal;">Thanks</span></div><div><span style=": rgb251, 251, 253; line-height: normal;">Manju</span></div>]]>
   </description>
   <pubDate>Wed, 03 Apr 2013 23:49:20 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4080&amp;PID=16172#16172</guid>
  </item> 
  <item>
   <title>Selectively Remove queries from QueryCache :   Manju,It sounds like your...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4080&amp;PID=16160#16160</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 4080<br /><strong>Posted:</strong> 02-Apr-2013 at 11:42pm<br /><br />Manju,<div>It sounds like your rather large application is using a single EntityManager for everything. That's fine for a small application, but a large application should be broken up into units of work, each one using its own EntityManager. For commonly used entities a second level cache approach can be utilized. You may wanna take a look at our reference application where you can see this in action. There is a series of videos that walk you through the code etc.</div><div><br></div><div><a href="http://drc.ideablade.com/devforce-2012/bin/view/&#068;ocumentati&#111;n/cocktail-reference-applicati&#111;n" target="_blank">http://drc.ideablade.com/devforce-2012/bin/view/Documentation/cocktail-reference-application</a></div><span style="font-size:10px"><br /><br />Edited by mgood - 02-Apr-2013 at 11:55pm</span>]]>
   </description>
   <pubDate>Tue, 02 Apr 2013 23:42:37 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4080&amp;PID=16160#16160</guid>
  </item> 
  <item>
   <title>Selectively Remove queries from QueryCache : HiWe are using Optimized QueryStrategy....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4080&amp;PID=16158#16158</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1754" rel="nofollow">myr_zero</a><br /><strong>Subject:</strong> 4080<br /><strong>Posted:</strong> 02-Apr-2013 at 8:51pm<br /><br />Hi<div><br></div><div>We are using Optimized QueryStrategy. So when the same query is called again we want to make use of Cache. But as the number of queries getting executed increases, number of queries in QueryCache and hence number of entities in EntityCache will also increase.&nbsp;</div><div><br></div><div>Some of the queries, entities which were called in the start of the application will remain in the cache for the life time of application&nbsp;even though they are not used anymore. we want to remove those entities and queries from Cache.</div><div><br></div><div>And also some of the entities which were not accessed since a specific time duration, need to be removed/refreshed.</div><div><br></div><div>The purpose of this is to optimized utilization of memory. We have large database with lots of entities. We don't want to pile up memory with a large Cache. At the same time we don't want to miss the advantage of using cache for better performance.</div><div><br></div><div>This is the reason to go for manual management of Cache.</div><div><br></div><div>If you can suggest any alternative or any such implementation already provided by DevForce which we are not aware, then it would be really helpful for us.</div><div><br></div><div><br></div><div>Thanks</div><div>Manju</div>]]>
   </description>
   <pubDate>Tue, 02 Apr 2013 20:51:26 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4080&amp;PID=16158#16158</guid>
  </item> 
  <item>
   <title>Selectively Remove queries from QueryCache : myr-zero,  We don&amp;#039;t have...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4080&amp;PID=16144#16144</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 4080<br /><strong>Posted:</strong> 01-Apr-2013 at 10:40am<br /><br />myr-zero,<br /><br />We don't have an estimated date for this fix.<br /><br />I'd suggest relying on DevForce to manage the QueryCache. <br /><br />Note that since manually managing the QueryCache is not very common and DevForce manages it properly, this issue ranks lowers in our priority list.<br /><br />Kind regards.]]>
   </description>
   <pubDate>Mon, 01 Apr 2013 10:40:15 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4080&amp;PID=16144#16144</guid>
  </item> 
  <item>
   <title>Selectively Remove queries from QueryCache : Oops!! That is bad news for me.Even...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4080&amp;PID=16132#16132</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1754" rel="nofollow">myr_zero</a><br /><strong>Subject:</strong> 4080<br /><strong>Posted:</strong> 26-Mar-2013 at 6:18pm<br /><br />Oops!! That is bad news for me.<div><br></div><div>Even I tried with EntityKey as parameter to QueryCache.Remove method. This is not working too.</div><div><br></div><div>Is there estimated time on when the fix for this bug be available?</div><div><br></div><div>Thanks you</div>]]>
   </description>
   <pubDate>Tue, 26 Mar 2013 18:18:42 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4080&amp;PID=16132#16132</guid>
  </item> 
  <item>
   <title>Selectively Remove queries from QueryCache : Hi myr_zero,I was able to reproduce...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4080&amp;PID=16129#16129</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 4080<br /><strong>Posted:</strong> 26-Mar-2013 at 10:49am<br /><br />Hi myr_zero,<div><br></div><div>I was able to reproduce the issue. I am filing a bug and will let you know once we have a fix.</div>]]>
   </description>
   <pubDate>Tue, 26 Mar 2013 10:49:32 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4080&amp;PID=16129#16129</guid>
  </item> 
  <item>
   <title>Selectively Remove queries from QueryCache : HiI am trying to write code to...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4080&amp;PID=16127#16127</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1754" rel="nofollow">myr_zero</a><br /><strong>Subject:</strong> 4080<br /><strong>Posted:</strong> 25-Mar-2013 at 7:07pm<br /><br />Hi<div><br></div><div>I am trying to write code to manually manage EntityManager cache. I have code which gives me the list of entities which needs to be removed from the EntityCache.</div><div><br></div><div>What I want to do is remove the entity form EntityCache and remove related queries from QueryCache.</div><div><br></div><div>DevForce provide method&nbsp;<span style="color: rgb0, 0, 102; line-height: normal;">RemoveEntity</span><span style="line-height: 1.4;">&nbsp;which takes two parameters. First parameter is entity and second parameter is flag to clear query cache. If I do not provide second parameter or provide it as true, then DevForce clears the whole QueryCache, not just the queries related to the entity being removed. This is not solution for me since I dont want to remove all the queries.</span></div><div><span style="line-height: 1.4;"><br></span></div><div><span style="line-height: 1.4;">So I decided on using QueryCache.Remove method. This method comes with three signatures. Two of which use EntityKey. I dont have entity key with me now. So I have to use the other method which use Entity Type.</span></div><div><span style="line-height: 1.4;"><br></span></div><div><span style="line-height: 1.4;">I use it like this</span></div><div><span style="line-height: 1.4;"><br></span></div><div><span style="line-height: 1.4;">entityManager.QueryCache.Remove(entity.GetType())</span></div><div><span style="line-height: 1.4;"><br></span></div><div><span style="line-height: 1.4;">But this seems to be not doing the work. I can still see the same queries present in the QueryCache. A query which uses the specified type of entity is not removed from the query cache.</span></div><div><span style="line-height: 1.4;"><br></span></div><div><span style="line-height: 1.4;">Any help in this would be&nbsp;</span>appreciated</div><div><span style="line-height: 1.4;"><br></span></div><div><span style="line-height: 1.4;"><br></span></div><div><span style="line-height: 1.4;">Thanks</span></div>]]>
   </description>
   <pubDate>Mon, 25 Mar 2013 19:07:23 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4080&amp;PID=16127#16127</guid>
  </item> 
 </channel>
</rss>