<?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 : 1:n relation does not validate</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : 1:n relation does not validate</description>
  <pubDate>Sat, 11 Apr 2026 13:51:03 -700</pubDate>
  <lastBuildDate>Tue, 19 Oct 2010 18:15:34 -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=2222</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>1:n relation does not validate : We fixed this problem (both the...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2222&amp;PID=8840#8840</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> 2222<br /><strong>Posted:</strong> 19-Oct-2010 at 6:15pm<br /><br />We fixed this problem (both the original issue and the "morphed" problem) in v6.0.6, which is now available.]]>
   </description>
   <pubDate>Tue, 19 Oct 2010 18:15:34 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2222&amp;PID=8840#8840</guid>
  </item> 
  <item>
   <title>1:n relation does not validate : Sorry to say it has not been fixed....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2222&amp;PID=8800#8800</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> 2222<br /><strong>Posted:</strong> 15-Oct-2010 at 12:32pm<br /><br />Sorry to say it has not been fixed. <DIV>&nbsp;</DIV><DIV>The problem only occurs when the child's FK is also its PK, but making a modification to the schema&nbsp;likely has other undesirable effects, like the EDM not allowing the relationship.</DIV><DIV>&nbsp;</DIV><DIV>Although it won't help now, the problem has now morphed slightly.&nbsp; The error now occurs only when the PendingEntity is not found (it doesn't exist in the DB), so what you'd now see is bindings sometimes working and sometimes not, depending on the data.</DIV><DIV>&nbsp;</DIV><DIV>Unfortunately a bug report was never opened for your earlier query about this issue, but I've opened one now and we will have the problem fixed in one of the 6.0.7 EAP drops.</DIV>]]>
   </description>
   <pubDate>Fri, 15 Oct 2010 12:32:10 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2222&amp;PID=8800#8800</guid>
  </item> 
  <item>
   <title>1:n relation does not validate : Guys, can you tell me whether...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2222&amp;PID=8788#8788</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=485" rel="nofollow">jsobell</a><br /><strong>Subject:</strong> 2222<br /><strong>Posted:</strong> 13-Oct-2010 at 8:10pm<br /><br />Guys, can you tell me whether or not this issue has been fixed in 6.0.6?]]>
   </description>
   <pubDate>Wed, 13 Oct 2010 20:10:57 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2222&amp;PID=8788#8788</guid>
  </item> 
  <item>
   <title>1:n relation does not validate : Sorry, I got the instamces mixed...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2222&amp;PID=8762#8762</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=485" rel="nofollow">jsobell</a><br /><strong>Subject:</strong> 2222<br /><strong>Posted:</strong> 11-Oct-2010 at 5:18pm<br /><br />Sorry, I got the instamces mixed up. The issue is in 1-1 relationships, where you have a maximum of one Document per Person, and the Document containst the PersonID.<br>PendingEntityLists seem to work fine, but if you have Person.Document as a navigational property referring to a Document with a PersonID foreign key relationship, you get this error.<br>I suppose I could do a workaround by insisting that each person has 'Documents' instead of a 'Document', and always refer to the first instance, although this is messy in the Binding; How would you refer to Binding=Person.Documents&#091;0&#093;? Presumably I have to embed it in a ItemsControl, and assume it only ever has a single item.<br><br>This may sound an unusual structure, but it occurs every time you have an optional object associated with another object. In my case I have optional 'Target' values associated with a financial object, hence the 1:0-1 relationship with B referring to A rather than vice-versa. I know that A could in theory point to B, but this would require an additional field in A, and we have no control over that database structure.<br><br>]]>
   </description>
   <pubDate>Mon, 11 Oct 2010 17:18:01 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2222&amp;PID=8762#8762</guid>
  </item> 
  <item>
   <title>1:n relation does not validate : Jason, do you have more information...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2222&amp;PID=8760#8760</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> 2222<br /><strong>Posted:</strong> 11-Oct-2010 at 1:07pm<br /><br />Jason, do you have more information on this lazy loading problem you see?&nbsp;&nbsp; In a 1:M relationship, asynchronous navigation from a principal (Person) to its dependents (Documents) will return an empty&nbsp;PendingEntityList and not individual Pending entities.&nbsp; Asynchronous navigation from a dependent to the principal (Document.Person here) should not set any fields on the pending Person entity.&nbsp; <DIV>&nbsp;</DIV><DIV>We did have a bug, fixed in 6.0.6, where asynchronous navigation from a dependent to its parent would cause the dependent to go to a Modified state (it's FK property was being result to null/0).&nbsp; Could this be the problem you've seen?</DIV>]]>
   </description>
   <pubDate>Mon, 11 Oct 2010 13:07:41 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2222&amp;PID=8760#8760</guid>
  </item> 
  <item>
   <title>1:n relation does not validate : The EF diagram does not enforce...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2222&amp;PID=8759#8759</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=485" rel="nofollow">jsobell</a><br /><strong>Subject:</strong> 2222<br /><strong>Posted:</strong> 11-Oct-2010 at 3:58am<br /><br />The EF diagram does not enforce referential rules, and if your Document allows null in the PersonID field then this is presumably going to be allowed. If you generated the EF from the database then you would find that was a 0/1-&gt;*<br>If the Document-Person relationship in the database was a foreign key (as it should be in this case) this operation would be invalid and you would at least get an exception from the database.<br><br>There is another 'funny' with 1-&gt;* relationships in DF regarding lazy-loading, so I'm trying to avoid these until they are fixed. I suspect you might hit the same problem when you start retrieving your records.<br>What appears to happen is that if you have a binding to (or you try to read in code) the Document associated with a person, DF creates a 'Pending' Document, then tries to set it's PersonId to the current one.&nbsp; As the Document object is 'Pending retrieval from the database' this raises an internal exception (you can't write to Pending objects), so your app crashes :/<br><br>It's weird getting a 'write error' exception on a property Get, but I believe this is being looked into at the moment. I certainly hope so, as it has one of my app developments to a standstill.<br><br>]]>
   </description>
   <pubDate>Mon, 11 Oct 2010 03:58:11 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2222&amp;PID=8759#8759</guid>
  </item> 
  <item>
   <title>1:n relation does not validate : In my entity model I defined a...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2222&amp;PID=8758#8758</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=945" rel="nofollow">mseeli</a><br /><strong>Subject:</strong> 2222<br /><strong>Posted:</strong> 11-Oct-2010 at 2:00am<br /><br />In my entity model I defined a 1:n definition between Person and Document<div>A person can have many documents and each document belongs to one person.</div><div><br></div><div>I try to test it with the following test:</div><div><br></div><div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&#091;TestMethod&#093;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&#091;ExpectedException(typeof(Exception))&#093;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public void SaveDocumentWithoutPerson</div><div><br></div><div><br></div><div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Dokument newDokument= new Dokument();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;newDokument.Id = System.Guid.NewGuid();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// set dokument properties</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;newDokument.ErfasstAm = DateTime.Now;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;newDokument.MutiertAm = DateTime.Now;</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Manager.AddEntity(newDokument); &nbsp; &nbsp;// I expected that this would throw an exception</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Manager.SaveChanges();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div></div><div><br></div><div>It does not throw an exception and the document without the person ends up in the database!</div><div>How is that possible?</div><div><br></div><div>Here the properties of the association &nbsp;(Person is called MasterEntity)</div><div><br></div><div><br></div><div><img src="http://www.ideablade.com/forum/uploads/945/Properties.png" height="298" width="584" border="0" />()</div></div>]]>
   </description>
   <pubDate>Mon, 11 Oct 2010 02:00:09 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2222&amp;PID=8758#8758</guid>
  </item> 
 </channel>
</rss>