<?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 : Navigation property &quot;out of memory&quot; exception</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Navigation property &quot;out of memory&quot; exception</description>
  <pubDate>Tue, 21 Apr 2026 14:12:30 -700</pubDate>
  <lastBuildDate>Wed, 21 Jul 2010 08:14:18 -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=1987</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>Navigation property &quot;out of memory&quot; exception : We&amp;#039;re in the midst of converting...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1987&amp;PID=7720#7720</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=662" rel="nofollow">dpollot44</a><br /><strong>Subject:</strong> 1987<br /><strong>Posted:</strong> 21-Jul-2010 at 8:14am<br /><br />We're in the midst of converting our first application using DF2010, so I apologize if it seems as though I'm inundating this forum with posts, but hopefully they'll be of use to future readers, who'll not have to spend the hours upon hours I have debugging...<br><br>I'm running into problems with a couple of associations (and their navigation properties).&nbsp; Almost all of the navigation properties within this application which has about 7 associations work fine, but there seem to be a couple stubborn hold outs.<br><br>I'll start by giving you a snippet from the <font color="#0000ff">EntityRelations</font> class:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font face="Courier New, Courier, mono" size="1">/// &lt;summary&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /// Represents the relationship between <br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; /// &lt;see cref="Holding"/&gt; and &lt;see cref="TaxLot"/&gt;.<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /// &lt;/summary&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /// &lt;remarks&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /// Relation: FKHoldingTaxLots<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ///&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; To *: TaxLot (OpenOrdersMaintenance.Data.TaxLot)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ///&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; From 0|1: Holding (OpenOrdersMaintenance.Data.Holding)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /// &lt;/remarks&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public static IbEm.EntityRelation FKHoldingTaxLots = new IbEm.EntityRelation(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; typeof(TaxLot),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; typeof(Holding), &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; new IbEm.DataEntityProperty&#091;&#093; { TaxLot.PropertyMetadata.HoCode },<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; new IbEm.DataEntityProperty&#091;&#093; { Holding.PropertyMetadata.HoCode },&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; IbEm.Multiplicity.Many,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; IbEm.Multiplicity.ZeroOrOne,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; IbEm.OnDeleteMode.None,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; IbEm.OnDeleteMode.None,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; "FKHoldingTaxLots");</font><br><br>Given the above relationship, and this snippet (from my test code):<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font face="Courier New, Courier, mono" size="1">// This works<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var holding = Context.EntityManager.Holdings.Where(h =&gt; h.HoCode == 807300).FirstOrDefault();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; holding.LoadNavigationProperty("Client");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; holding.LoadNavigationProperty("HoldingTaxLots");<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // This DOES NOT WORK<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //&nbsp; LoadNavigationProperty does this -&gt; this.EntityAspect.GetRelatedEntity&lt;Holding&gt;(EntityRelations.FKHoldingTaxLots.Role2.Link);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var taxlot = Context.EntityManager.TaxLots.Where(t=&gt;t.HoCode == 807301).FirstOrDefault();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; taxlot.LoadNavigationProperty("HoldingParent");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var holdingParent = taxlot.HoldingParent;</font><br><br>The second test (the one that doesn't work) actually DOES work if I run the first test, but if I comment the first test out, the second fails.&nbsp; When I say "fails", I really mean that this line of code:<br><font face="Courier New, Courier, mono">&nbsp; this.EntityAspect.GetRelatedEntity&lt;Holding&gt;(EntityRelations.FKHoldingTaxLots.Role2.Link);</font><br>never makes it back and I wind up getting "out of memory" exceptions on subsequent tries to run the app.&nbsp; DF doesn't throw any exceptions... it just hangs.<br><br>I've set up a test project (not the project that contains the code above) that contains both an IdeaBlade model as well as an EF model derived from the same Edmx file, so that I can switch back and forth and what works where.&nbsp; That project is clean of any developer involvement in terms of extended codegen/business object addons and such.&nbsp; It's absolutely out of the box so that I can be sure that it's not something that I've screwed up...<br><br>The tests above both work fine in EF, but fail in DF.<br>]]>
   </description>
   <pubDate>Wed, 21 Jul 2010 08:14:18 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1987&amp;PID=7720#7720</guid>
  </item> 
 </channel>
</rss>