<?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 : Lazy loading, how does it work?</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Lazy loading, how does it work?</description>
  <pubDate>Tue, 12 May 2026 23:21:45 -700</pubDate>
  <lastBuildDate>Fri, 19 Oct 2012 17:24: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=3724</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>Lazy loading, how does it work? :   Yes, null-entity is what I...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3724&amp;PID=14925#14925</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1264" rel="nofollow">katit</a><br /><strong>Subject:</strong> 3724<br /><strong>Posted:</strong> 19-Oct-2012 at 5:24pm<br /><br />Yes, null-entity is what I needed to know. Otherwise - I don't see a way to "wait" programmaticaly (I'm sure this way exists) for entities loaded when I access them.<div>&nbsp;</div><div>In my scenario - I ended up disabling lazy-loading (as in first post) and now I load entity on demand controlling async behavior..&nbsp;</div>]]>
   </description>
   <pubDate>Fri, 19 Oct 2012 17:24:20 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3724&amp;PID=14925#14925</guid>
  </item> 
  <item>
   <title>Lazy loading, how does it work? :   By definition, a &amp;#034;lazily...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3724&amp;PID=14924#14924</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> 3724<br /><strong>Posted:</strong> 19-Oct-2012 at 5:08pm<br /><br />By definition, a "lazily loaded" navigation property is one which will be retrieved upon the first call to the property getter.&nbsp; This happens regardless of any data binding in place; for example, the first call to anOrder.OrderDetails will retrieve the OrderDetails for the order.<div>&nbsp;</div><div>If you haven't changed the reference strategy, the call to SysDocument.SysFile will lazily load the SysFile.&nbsp; If you've set the reference load strategy to DoNotLoad, which you did in an earlier post, then the SysFile won't be retrieved.&nbsp;&nbsp; DevForce scalar navigation properties don't return null, they return a null entity if no entity exists.&nbsp;&nbsp; More here - <a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/null-entity" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/null-entity</a>.</div><div>&nbsp;</div><div>Also remember that if you're working in Silverlight all lazy loads are asynchronous.&nbsp; When called, these properties return a pending entity or pending entity list.</div><div>&nbsp;</div><div>&nbsp;</div>]]>
   </description>
   <pubDate>Fri, 19 Oct 2012 17:08:43 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3724&amp;PID=14924#14924</guid>
  </item> 
  <item>
   <title>Lazy loading, how does it work? :   Follow up question on dealing...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3724&amp;PID=14923#14923</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1264" rel="nofollow">katit</a><br /><strong>Subject:</strong> 3724<br /><strong>Posted:</strong> 19-Oct-2012 at 4:02pm<br /><br />Follow up question on dealing with Lazy loaded entities. I figured that DevForce knows how to fetch it when data bound.<div>&nbsp;</div><div>How do I programmaticaly fetch it? In my case I have SYSDocument which describes document properties. It's child entity is SYSFile - this is table where I store blobs.</div><div>&nbsp;</div><div>User wants to download file and I need to bring this SYSFile to the client. If I just access SYSFile.Data property in code than I get empty byte array (byte&#091;&#093; Data), it's not lazy loaded.</div><div>&nbsp;</div><div>I tried to run code like this but it didn't work either:</div><div>var query = documentPlacement.SYSDocument.SYSFile.ToQuery();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; query.ExecuteAsync(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; op =&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (op.HasError)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var aa = op.Error;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var a = op.Results;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var b = a;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });</div><div>&nbsp;</div><div>op.Results is empty. I understand that I can write query to fetch it myself. But how do I know that I need to fetch it? SYSDocument.SYSFile is always present (not NULL). How to programmaticaly determine if this entity loaded?</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div>]]>
   </description>
   <pubDate>Fri, 19 Oct 2012 16:02:36 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3724&amp;PID=14923#14923</guid>
  </item> 
  <item>
   <title>Lazy loading, how does it work? :   Simple :) I found it. It was...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3724&amp;PID=14908#14908</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1264" rel="nofollow">katit</a><br /><strong>Subject:</strong> 3724<br /><strong>Posted:</strong> 18-Oct-2012 at 4:38pm<br /><br />Simple :) I found it. It was my "Is Dirty" check on parent entity where I was checking ParentEntity.EntityInQuestions.EntityAspect...<div></div>]]>
   </description>
   <pubDate>Thu, 18 Oct 2012 16:38:52 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3724&amp;PID=14908#14908</guid>
  </item> 
  <item>
   <title>Lazy loading, how does it work? :   You can set a breakpoint on...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3724&amp;PID=14893#14893</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> 3724<br /><strong>Posted:</strong> 17-Oct-2012 at 6:27pm<br /><br />You can set a breakpoint on the navigation property's getter, and when the break point is hit check the stack.]]>
   </description>
   <pubDate>Wed, 17 Oct 2012 18:27:20 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3724&amp;PID=14893#14893</guid>
  </item> 
  <item>
   <title>Lazy loading, how does it work? :   I don&amp;#039;t have anything...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3724&amp;PID=14892#14892</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1264" rel="nofollow">katit</a><br /><strong>Subject:</strong> 3724<br /><strong>Posted:</strong> 17-Oct-2012 at 6:15pm<br /><br />I don't have anything like that (no data grid) and nothing breaks if I specify reference strategy.<div>&nbsp;</div><div>Is there any way for me to trace who is accessing this entity to see why it's doing it? I like lazy loading behavior when I need entity but in this case it doesn't seem to be needed..</div>]]>
   </description>
   <pubDate>Wed, 17 Oct 2012 18:15:02 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3724&amp;PID=14892#14892</guid>
  </item> 
  <item>
   <title>Lazy loading, how does it work? :   Lazy loading is triggered...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3724&amp;PID=14890#14890</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> 3724<br /><strong>Posted:</strong> 17-Oct-2012 at 5:53pm<br /><br />Lazy loading is triggered when a navigation property is accessed and it hasn't already been loaded, or the load strategy indicates it should always be loaded from the data source.&nbsp; <div>&nbsp;</div><div>You might be seeing lazy loading occur&nbsp;for data loaded into a grid, particularly when columns are auto-generated.&nbsp; For example, if displaying Order information and using auto-generated columns, the OrderDetails for each order will be lazily loaded.</div><div>&nbsp;</div><div>As you've noted, you can use the ReferenceStrategy to change the loading behavior for navigation properties.&nbsp; Here's more information - <a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/navigati&#111;n-properties-data-retrieval" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/navigation-properties-data-retrieval</a>.</div>]]>
   </description>
   <pubDate>Wed, 17 Oct 2012 17:53:06 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3724&amp;PID=14890#14890</guid>
  </item> 
  <item>
   <title>Lazy loading, how does it work? :   Some times I see it working...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3724&amp;PID=14889#14889</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1264" rel="nofollow">katit</a><br /><strong>Subject:</strong> 3724<br /><strong>Posted:</strong> 17-Oct-2012 at 1:01pm<br /><br />Some times I see it working as expected(it is in other places) and some times when I run profiler I see data being fetched when there is no need for it.<div>&nbsp;</div><div>I have table Document and table File. File contains binary data and I don't want it to load unless I need this data. </div><div>&nbsp;</div><div>SYSDocument.PropertyMetadata.SYSFile.ReferenceStrategy = new EntityReferenceStrategy(EntityReferenceLoadStrategy.DoNotLoad, MergeStrategy.OverwriteChanges);<br></div><div>After placing code above it works (entity not loaded) and no errors which proves me that my code doesn't need "File" just yet. No bindings, nothing needs it.</div><div>&nbsp;</div><div>Question is, what triggers lazy loading and how I can see which line of code caused lazy loading to happen? I like the feature but also want to be able to contol it. Or at least understand why DevForce decides to load it.</div><div>&nbsp;</div><div>&nbsp;</div>]]>
   </description>
   <pubDate>Wed, 17 Oct 2012 13:01:49 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3724&amp;PID=14889#14889</guid>
  </item> 
 </channel>
</rss>