<?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 : Delete Persistence Order</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Delete Persistence Order</description>
  <pubDate>Wed, 10 Jun 2026 14:26:32 -700</pubDate>
  <lastBuildDate>Wed, 22 Jul 2009 13:14:13 -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=1382</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>Delete Persistence Order : John:I assume that the 1-to-M...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1382&amp;PID=5002#5002</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=4" rel="nofollow">GregD</a><br /><strong>Subject:</strong> 1382<br /><strong>Posted:</strong> 22-Jul-2009 at 1:14pm<br /><br />John:<br><br>I assume that the 1-to-M between Account and AccountAddress is implemented with a foreign key in AccountAddress that points to the parent Account. If Account also has a foreign key that points to AccountAddress (for the primary Address), then we can't know whether to delete AccountAddress entities first, or Account entities, because it depends upon what your user has done with the data in a particular session.<br><br>Personally, I would put a boolean field in the AccountAddress table to indicate whether a given AccountAddress record is a primary one, and then enforce a constraint that only one AccountAddress record in a set with the same parent Account be so designated.&nbsp; Your Account.PrimaryAccountAddress property would then be a custom one that returns the one AccountAddress entity (if there is one) that is (a) a child of your Account instance and (b) is marked as a primary.<br><br>]]>
   </description>
   <pubDate>Wed, 22 Jul 2009 13:14:13 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1382&amp;PID=5002#5002</guid>
  </item> 
  <item>
   <title>Delete Persistence Order : Hi all,  I have a database with...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1382&amp;PID=4991#4991</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=316" rel="nofollow">dobbo</a><br /><strong>Subject:</strong> 1382<br /><strong>Posted:</strong> 21-Jul-2009 at 7:32am<br /><br /><DIV>Hi all,</DIV><DIV>&nbsp;</DIV><DIV>I have a database with three tables:</DIV><DIV>&nbsp;</DIV><DIV>Account</DIV><DIV>AccountAddress</DIV><DIV>Address</DIV><DIV>&nbsp;</DIV><DIV>These are used to describe a many to many relationship between Account and Address.</DIV><DIV>I also have a field in Account that points to a specific AccountAddress record to define the Primary Address when dealing with that account. </DIV><DIV>The relationships set up are as follows:</DIV><DIV>&nbsp;</DIV><DIV>Account -&gt; AccountAddress on the appropriate keys</DIV><DIV>Account -&gt; AccountAddress pointing to a specific record on the appropriate key</DIV><DIV>AccountAddress -&gt; Address on the appropriate keys.</DIV><DIV>&nbsp;</DIV><DIV>Using Classic DevForce (3.6.2) and a CAB solution based on Cabana,&nbsp;I have a problem when I change the field in Account to point to a different AccountAddress record and delete the original AccountAddress.</DIV><DIV>&nbsp;</DIV><DIV>When I save the Account record I then get an error show below:</DIV><DIV>&nbsp;</DIV><DIV><img src="http://www.ideablade.com/forum/uploads/316/Error.png" height="345" width="499" border="0" /></DIV><DIV>&nbsp;</DIV><DIV>I think this is because the persistence order or, perhaps an issue with our relationships,&nbsp;is wrong.</DIV><DIV>&nbsp;</DIV><DIV>The error is pointing to the relationship pointing to the specific record.</DIV><DIV>&nbsp;</DIV><DIV>If I save the content before deleting, then delete the original address it works but this is not an ideal solution.</DIV><DIV>&nbsp;</DIV><DIV>Does anyone have any suggestions on how I can go about solving this problem.</DIV><DIV>&nbsp;</DIV><DIV>Thanks</DIV><DIV>&nbsp;</DIV><DIV>John</DIV>]]>
   </description>
   <pubDate>Tue, 21 Jul 2009 07:32:32 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1382&amp;PID=4991#4991</guid>
  </item> 
 </channel>
</rss>