<?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 : Determining persistence order</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Determining persistence order</description>
  <pubDate>Mon, 13 Apr 2026 00:59:25 -700</pubDate>
  <lastBuildDate>Thu, 12 Jul 2007 15:34:35 -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=202</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>Determining persistence order : You can use a different persistence...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=202&amp;PID=445#445</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=21" rel="nofollow">IdeaBlade</a><br /><strong>Subject:</strong> 202<br /><strong>Posted:</strong> 12-Jul-2007 at 3:34pm<br /><br /><P =Ms&#111;normal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">You can use a different persistence order for each save.</SPAN></FONT></P>]]>
   </description>
   <pubDate>Thu, 12 Jul 2007 15:34:35 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=202&amp;PID=445#445</guid>
  </item> 
  <item>
   <title>Determining persistence order : Our persistence order issue is...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=202&amp;PID=444#444</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=20" rel="nofollow">Customer</a><br /><strong>Subject:</strong> 202<br /><strong>Posted:</strong> 12-Jul-2007 at 3:34pm<br /><br /><P =Ms&#111;normal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Our persistence order issue is not for rows in the same table.&nbsp; Rather it is in regards to a standard parent/child relationship between a parent table and a child table.&nbsp; The default persistence order was working fine until recently, when suddenly it wanted to save the child before the parent.&nbsp; For the specific parent/child relationship in question, we overrode the persistence order and that seemed to work fine.&nbsp; However we then got an error for a different parent/child relationship.</SPAN></FONT><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p>&nbsp;</o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">So our question is:&nbsp; If we override the persistence order for a particular relationship, does that invalidate all of the other default persistence orders.&nbsp; In other words, if we override one relationship persistence order, do we then have to override them all?</SPAN></FONT></P>]]>
   </description>
   <pubDate>Thu, 12 Jul 2007 15:34:00 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=202&amp;PID=444#444</guid>
  </item> 
  <item>
   <title>Determining persistence order :  Here is how Persistence Order...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=202&amp;PID=443#443</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=21" rel="nofollow">IdeaBlade</a><br /><strong>Subject:</strong> 202<br /><strong>Posted:</strong> 12-Jul-2007 at 3:33pm<br /><br /><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;<P =Ms&#111;normal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Here is how Persistence Order is determined for any SaveChanges request:<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal style="MARGIN-LEFT: 0.75in; TEXT-INDENT: -0.5in; mso-list: l1 level1 lfo1"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN style="mso-list: Ignore">(1)<FONT face="Times New Roman" size=1><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></SPAN></FONT><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Typically, a default Persistence Order is determined for all of the tables which participate in the save.&nbsp; The default order is determined automatically by doing a “reverse topological sort”.&nbsp; In rare cases, this may not be the order that you want, and if that is the case, you can override this Persistence Order with your own Persistencce Order,<o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal style="MARGIN-LEFT: 0.75in; TEXT-INDENT: -0.5in; mso-list: l1 level1 lfo1"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN style="mso-list: Ignore">(2)<FONT face="Times New Roman" size=1><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></SPAN></FONT><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Deletions occur first on a table-by-table basis.&nbsp; Deletions occur in reverse Persistence Order.<o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal style="MARGIN-LEFT: 0.75in; TEXT-INDENT: -0.5in; mso-list: l1 level1 lfo1"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN style="mso-list: Ignore">(3)<FONT face="Times New Roman" size=1><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></SPAN></FONT><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Adds and updates follow next and at the same time on a table-by-table basis according to the Persistence Order.<o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal style="MARGIN-LEFT: 0.75in; TEXT-INDENT: -0.5in; mso-list: l1 level1 lfo1"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN style="mso-list: Ignore">(4)<FONT face="Times New Roman" size=1><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></SPAN></FONT><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Within a given table and within a given SaveTable operation (Delete versus Add/Modify), there is no predictable order.<o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Some comments on your observations:<o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal style="MARGIN-LEFT: 0.75in; TEXT-INDENT: -0.5in; mso-list: l0 level1 lfo2"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN style="mso-list: Ignore">(1)<FONT face="Times New Roman" size=1><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></SPAN></FONT><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Your comment that there is no predictable Persistence Order between child records and parent records is correct if child and parent records belong to the same table.<o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal style="MARGIN-LEFT: 0.75in; TEXT-INDENT: -0.5in; mso-list: l0 level1 lfo2"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN style="mso-list: Ignore">(2)<FONT face="Times New Roman" size=1><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></SPAN></FONT><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">The typical way to handle limitations of Persistence Order is to make multiple saves. &nbsp;This is a problem if you want to do the save as a single transaction. &nbsp;Here is a coment from our senior architect on the issue of setting dependencies among or ordering records of the same type when performing a save:<o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><I><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-STYLE: italic; FONT-FAMILY: Arial">This is a hard problem.&nbsp; We currently have no way of setting dependencies among or ordering records of the same type when performing a save.&nbsp; What we actually do internally is a DataAdapter.Update() call for each individual table, and this method iterates through the data rows without regard to contents.&nbsp; We don’t currently plan to change this logic, so let’s see if a workaround will be sufficient.</SPAN></FONT></I><I><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-STYLE: italic; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></I></P></o:p></SPAN>]]>
   </description>
   <pubDate>Thu, 12 Jul 2007 15:33:06 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=202&amp;PID=443#443</guid>
  </item> 
  <item>
   <title>Determining persistence order : For a few weeks now, we have been...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=202&amp;PID=442#442</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=20" rel="nofollow">Customer</a><br /><strong>Subject:</strong> 202<br /><strong>Posted:</strong> 12-Jul-2007 at 3:31pm<br /><br /><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">For a few weeks now, we have been receiving very inconsistence foreign key constraint errors from the DB. &nbsp;After viewing SQL Profiler, it appears that child records are trying to be saved prior to the parent record, thus causing the constraint errors.</SPAN></FONT><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p>&nbsp;</o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Sometimes we get the errors, sometimes we don’t. &nbsp;We haven’t found any consistency.<o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Is there a way to determine what DevForce is using for the order with which it attempts to persist to the database? And how DevForce determines this order?<o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Are there any known issues with PersistenceOrder that we might work around?</SPAN></FONT></P>]]>
   </description>
   <pubDate>Thu, 12 Jul 2007 15:31:45 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=202&amp;PID=442#442</guid>
  </item> 
 </channel>
</rss>