<?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 : Deferred loading of empty relations</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2009 : Deferred loading of empty relations</description>
  <pubDate>Sat, 25 Apr 2026 08:33:57 -700</pubDate>
  <lastBuildDate>Thu, 04 Dec 2008 10:49:12 -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=977</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>Deferred loading of empty relations : This problem has been fixed, and...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=977&amp;PID=3682#3682</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 977<br /><strong>Posted:</strong> 04-Dec-2008 at 10:49am<br /><br />This problem has been fixed, and will be available in release 4.2.2.x, due December 10.]]>
   </description>
   <pubDate>Thu, 04 Dec 2008 10:49:12 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=977&amp;PID=3682#3682</guid>
  </item> 
  <item>
   <title>Deferred loading of empty relations : This behavior is not by design,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=977&amp;PID=3538#3538</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 977<br /><strong>Posted:</strong> 28-Oct-2008 at 7:31pm<br /><br /><P>This behavior is not by design, and we've opened a bug report to fix it.&nbsp; You're correct that the framework is not distinguishing between a never-loaded collection and an empty one.&nbsp; The good news, such as it is, is that the problem does not occur with scalar navigation properties, so going in the parent direction, e.g., aChild.ParentCategory, does not result in an unnecessary call to the server.</P><DIV>For right now, as a workaround you can set the ReferenceStrategy on the relation role in question, forcing it to not attempt to lazily load.&nbsp; The strategy is set on a role (or roles) in an EntityRelation, for example:</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp; EntityRelations.FK_Categories_Categories.Role2.ReferenceStrategy = EntityReferenceStrategy.NoLoad;</DIV>]]>
   </description>
   <pubDate>Tue, 28 Oct 2008 19:31:32 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=977&amp;PID=3538#3538</guid>
  </item> 
  <item>
   <title>Deferred loading of empty relations : Hi,  We&amp;#039;recurrently evaluating...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=977&amp;PID=3536#3536</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=394" rel="nofollow">allo</a><br /><strong>Subject:</strong> 977<br /><strong>Posted:</strong> 28-Oct-2008 at 12:19pm<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>We're&nbsp;currently evaluating DevForce EF, and have come across&nbsp;some unexpected behavior.</DIV><DIV>There's a possibility that this behavior is as-designed, but it would seem rather irrational, so here goes :</DIV><DIV>&nbsp;</DIV><DIV>We have a self-referencing Category table&nbsp;with&nbsp;internal hierarchical relationships.</DIV><DIV>Certainly,&nbsp;the business class&nbsp;Category&nbsp;has&nbsp;a&nbsp;collection property called&nbsp;Children to represent the relationship.</DIV><DIV>To get the entire hierarchy at once and to prevent any subsequent lazy-loading round-trips, we do something like this:</DIV><DIV><FONT size=2><FONT face="Courier New, Courier, mono"><FONT color=#0000ff></FONT></FONT></FONT>&nbsp;</DIV><DIV><FONT size=2><FONT face="Courier New, Courier, mono"><FONT color=#0000ff>var qry = from c in</FONT></FONT><FONT face="Courier New, Courier, mono" color=#0000ff> mgr.Categories.Include(Category.PathFor(c =&gt; c.Children))</FONT></FONT><FONT face="Courier New, Courier, mono"><FONT color=#0000ff><FONT size=2>select c;</FONT><FONT size=4></DIV></FONT></FONT></FONT><DIV>&nbsp;</DIV><DIV>Both&nbsp;the SQL Profiler and&nbsp;DebugLog.xml show that the original request indeed contains&nbsp;the instructions to&nbsp;include the span, and the collections certainly get populated correctly. </DIV><DIV>The awkward thing is this:&nbsp;when we <EM><U>subsequently</U></EM> access the Children collection&nbsp;on those entities that have no such children, an extra&nbsp;lazy-load&nbsp;request is made&nbsp;to the server.</DIV><DIV>It&nbsp;almost&nbsp;looks&nbsp;like&nbsp;the framework is for some reason unable to distinguish between a never-loaded collection and an emtpy one. Another possibility could be in the principle that the framework simply attempts to see if there's any children <EM>now </EM>as<EM> </EM>opposed to&nbsp;<EM>originally</EM>, which would&nbsp;itself present an inconsistency&nbsp;since in that case it would&nbsp;also have to go and see if there are new/deleted&nbsp;children&nbsp;in those entities that&nbsp;<EM>already</EM> had children,&nbsp;- yet&nbsp;this is not happening.</DIV><DIV>&nbsp;</DIV><DIV>Advance thanks for any helpful information!</DIV>]]>
   </description>
   <pubDate>Tue, 28 Oct 2008 12:19:21 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=977&amp;PID=3536#3536</guid>
  </item> 
 </channel>
</rss>