<?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 : QueryStrategy.DataSourceOnly doesn&#039;t work on related entities?</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : QueryStrategy.DataSourceOnly doesn&#039;t work on related entities?</description>
  <pubDate>Tue, 14 Apr 2026 12:57:18 -700</pubDate>
  <lastBuildDate>Tue, 08 Jul 2008 16:37:55 -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=877</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>QueryStrategy.DataSourceOnly doesn&#039;t work on related entities? : Dominique, Actually. this all...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=877&amp;PID=3195#3195</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=23" rel="nofollow">davidklitzke</a><br /><strong>Subject:</strong> 877<br /><strong>Posted:</strong> 08-Jul-2008 at 4:37pm<br /><br /><P>Dominique,</P><P>Actually. this all makes sense if you remember these simple rules:</P><P>(1) Every query has a Default Query Strategy (which may be overridden).</P><P>(2) The Default Query Strategy is Normal.</P><P>(3) The Normal Query Strategy looks to see if the query is in thw Query Cache.&nbsp; If so, it finds the result in the Persistence Manager Entity Cache.&nbsp; Otherwise it gets the result by querying the Databaase.</P><P>Now lets look at your cases:</P><P><strong>Use Case:</strong></P><P>Nothing unusual.</P><P><strong>OK:</strong></P><P>Nothing unusual.</P><P><strong>But </strong>Children Count won't be updated.</P><P>This happens because we are using Normal strategy.&nbsp; Query is found in the Query Cache, so we use Entity Cache, not database,</P><P><strong>Worse</strong>, it wont' removed deleted entities from the Entity List.</P><P>That's because you need to use <strong>RefetchEntitie</strong>s iwhenever you want to remove the deleted items..</P><P>&nbsp;</P><span style="font-size:10px"><br /><br />Edited by davidklitzke - 08-Jul-2008 at 4:39pm</span>]]>
   </description>
   <pubDate>Tue, 08 Jul 2008 16:37:55 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=877&amp;PID=3195#3195</guid>
  </item> 
  <item>
   <title>QueryStrategy.DataSourceOnly doesn&#039;t work on related entities? : Hi,I am wondering if I am missing...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=877&amp;PID=3184#3184</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=60" rel="nofollow">Dominique</a><br /><strong>Subject:</strong> 877<br /><strong>Posted:</strong> 08-Jul-2008 at 4:30am<br /><br /><P>Hi,</P><P>I am wondering if I am missing something. </P><P><strong>Use Case:</strong></P><P>I have a parent-child relation. I fetch some parents with QueryStrategy.DataSourceOnly. I show the number of child using parent.Childs.Count. The db can be updated from others users or applications.</P><P><strong>OK: </strong></P><P>If I insert/delete parent in the DB then they show up/disappear when I rerun the query.</P><P><strong>BUT:</strong></P><P>Children Count won't be updated if I insert new childs on existing parents in the DB</P><P>I get the same behaviour (not getting the lazy loaded child collection updated) if I show several properties of the children.</P><P><strong>WORSE:</strong></P><P>if I use a sapnQuery to get the childs eagerly then I wil get the new ones but it wan't remove the deleted one. This leads to several copies of the "same" entity.</P><P>this is a real problem when 2 different group of users works on the same datas (at different stage of a process) from diferent applications:</P><P>* UserRole1 register within ideablade app':</P><P>- Parent1 (child 1 and 2)</P><P>- Parent2 (child 3)</P><P><P>* UserRole2 later change the parent of a child from within another app' so that it is:</P><P> - Parent1 (child 1)</P><P> - Parent2 (child 2 and 3)</P><P>* userRole1 will then see:</P><P><P> - Parent1 (child 1 and 2)</P><P> - Parent2 (child 2 and 3)</P><P>This means that the "same" entity is present twice. (or is it only one collection that is not cleaned up?)</P><P>I am currently using Ideablade 3.5.4.1. Could you confirm this bug and if it is fixed in newer release of devforce?</P>--</P><P>Greetings </P><P>Dominique</P></P>]]>
   </description>
   <pubDate>Tue, 08 Jul 2008 04:30:48 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=877&amp;PID=3184#3184</guid>
  </item> 
 </channel>
</rss>