<?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 : Asynchronous cascading deletes</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Asynchronous cascading deletes</description>
  <pubDate>Sun, 12 Apr 2026 13:46:05 -700</pubDate>
  <lastBuildDate>Mon, 01 Nov 2010 00:43:40 -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=2178</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>Asynchronous cascading deletes : Aah, that makes sense.   I also...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2178&amp;PID=8992#8992</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=877" rel="nofollow">pompomJuice</a><br /><strong>Subject:</strong> 2178<br /><strong>Posted:</strong> 01-Nov-2010 at 12:43am<br /><br /><P style="LINE-HEIGHT: normal; MARGIN: 0cm 1.5pt 0.75pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN; mso-fareast-: EN-ZA" lang=EN>Aah, that makes sense. <?: prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.75pt 1.5pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN; mso-fareast-: EN-ZA" lang=EN>&nbsp;<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.75pt 1.5pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN; mso-fareast-: EN-ZA" lang=EN>I also was referring to a slightly different situation. <o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.75pt 1.5pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN; mso-fareast-: EN-ZA" lang=EN>&nbsp;<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.75pt 1.5pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN; mso-fareast-: EN-ZA" lang=EN>My issue was that if I&nbsp;delete an entity and it happens to have a 1..* NOT NULL&nbsp;parent child relationship with another entity that is set to cascade in the database. Such a delete is not possible unless you remove the 1..* loaded children from devforce, otherwise it deletes the parent and updates the children's FKs to&nbsp;NULL which causes FK exceptions. <o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.75pt 1.5pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN; mso-fareast-: EN-ZA" lang=EN>&nbsp;<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.75pt 1.5pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN; mso-fareast-: EN-ZA" lang=EN>Hope that makes more sense. ( And saw nothing on this topic in the documentation either? The documentation is very quiet about cascading deletes. )<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.75pt 1.5pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN; mso-fareast-: EN-ZA" lang=EN>&nbsp;<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.75pt 1.5pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN; mso-fareast-: EN-ZA" lang=EN>Personally&nbsp;I was hoping that devforce could see that a cascade is set via EF 4.0 and compensate. I was over optimistic</SPAN>.</P>]]>
   </description>
   <pubDate>Mon, 01 Nov 2010 00:43:40 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2178&amp;PID=8992#8992</guid>
  </item> 
  <item>
   <title>Asynchronous cascading deletes : pompomJuice,   The suggestion...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2178&amp;PID=8976#8976</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2178<br /><strong>Posted:</strong> 29-Oct-2010 at 9:41am<br /><br />pompomJuice, <DIV>&nbsp;</DIV><DIV>The suggestion I provided is for deleting all entities&nbsp;via DevForce.</DIV><DIV>Of course you can set the cascading delete in your Database and save the wire traffic.</DIV><DIV>&nbsp;</DIV><DIV>Sorry for the confusion.</DIV><DIV>&nbsp;</DIV><DIV>Silvio.</DIV>]]>
   </description>
   <pubDate>Fri, 29 Oct 2010 09:41:25 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2178&amp;PID=8976#8976</guid>
  </item> 
  <item>
   <title>Asynchronous cascading deletes : Indeed there is.  Drop any potential...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2178&amp;PID=8974#8974</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=877" rel="nofollow">pompomJuice</a><br /><strong>Subject:</strong> 2178<br /><strong>Posted:</strong> 29-Oct-2010 at 7:08am<br /><br />Indeed there is.<DIV>&nbsp;</DIV><DIV>Drop any potential cascade deletes from the Entity Manager's cache and then delete the entity, the database will take care of the rest. That way the EM wont fail on those updates. Makes sense.</DIV>]]>
   </description>
   <pubDate>Fri, 29 Oct 2010 07:08:36 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2178&amp;PID=8974#8974</guid>
  </item> 
  <item>
   <title>Asynchronous cascading deletes : That is ridiculous.   You fetch...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2178&amp;PID=8972#8972</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=877" rel="nofollow">pompomJuice</a><br /><strong>Subject:</strong> 2178<br /><strong>Posted:</strong> 29-Oct-2010 at 5:41am<br /><br />That is ridiculous. <DIV>&nbsp;</DIV><DIV>You fetch entities to delete them.&nbsp; What if you want to delete an entity that contains 100 images? (my situation)</DIV><DIV>&nbsp;</DIV><DIV>There has to be a better way?</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 29 Oct 2010 05:41:55 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2178&amp;PID=8972#8972</guid>
  </item> 
  <item>
   <title>Asynchronous cascading deletes :  The simplest way would be pre-loading...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2178&amp;PID=8600#8600</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2178<br /><strong>Posted:</strong> 22-Sep-2010 at 2:35pm<br /><br /><DIV>&nbsp;</DIV><DIV>The simplest way would be pre-loading all dependent objects and then deleting.</DIV><DIV>&nbsp;</DIV><DIV>You could also have it executed on the server (i.e. calling InvokeServerMethod).</DIV><DIV>&nbsp;</DIV><DIV>The example in the post you mentioned still works on DevForce2010 (only a slight minor change needed - AsyncCompletedCallback&lt;&gt; is not present in DevForce2010):</DIV><DIV>&nbsp;</DIV><DIV><FONT color=#2b91af size=2 face=C&#111;nsolas></FONT>&nbsp;</DIV><DIV><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>&nbsp; AsyncSerialTask</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>.Create&lt;</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Customer</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&gt;(</FONT></FONT><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas>"DeleteCustomer"</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>)</DIV><DIV><DIV>&nbsp; &nbsp; .AddAsyncAction&lt;</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>AsyncEventArgs</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&gt;(SetupDeletion)</DIV><DIV>&nbsp; &nbsp; .AddAction(args =&gt; DoDelete((</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Customer</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>)args.UserState))</DIV><DIV>&nbsp; &nbsp; .Execute(aCustomerToBeDeleted);</DIV><DIV></FONT></FONT><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas></FONT></FONT></FONT>&nbsp;</DIV><DIV><DIV><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas></DIV></FONT></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>&nbsp; private</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>void</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> SetupDeletion(</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Customer</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> cust, </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Action</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&lt;</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>AsyncEventArgs</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&gt; callback) {</DIV><DIV></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>&nbsp;&nbsp; &nbsp;var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> list = cust.Orders;</DIV><DIV></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>&nbsp; &nbsp; bool</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> isPending = list.IsPendingEntityList;</DIV><DIV></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>&nbsp; &nbsp; if</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> (isPending) {</DIV><DIV>&nbsp; &nbsp;&nbsp;&nbsp; list.PendingEntityListResolved += (o, args) =&gt; {</DIV><DIV>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; callback(</FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>new</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>AsyncEventArgs</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>(cust));</DIV><DIV>&nbsp; &nbsp;&nbsp;&nbsp; };</DIV><DIV>&nbsp; &nbsp; } </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>else</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> {</DIV><DIV>&nbsp; &nbsp;&nbsp;&nbsp; callback(</FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>new</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>AsyncEventArgs</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>(cust));</DIV><DIV>&nbsp; &nbsp; }</DIV><DIV>&nbsp; }</DIV><DIV>&nbsp;</DIV><DIV></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>&nbsp; private</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>void</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> DoDelete(</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Customer</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> cust) {</DIV><DIV>&nbsp;&nbsp;&nbsp; cust.EntityAspect.Delete();</DIV><DIV></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>&nbsp;&nbsp;&nbsp; foreach</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> (</FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> order </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>in</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> cust.Orders.ToList()) {</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; order.EntityAspect.Delete();</DIV><DIV>&nbsp;&nbsp;&nbsp; }</DIV><DIV>&nbsp; }</DIV></FONT></FONT></DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 22 Sep 2010 14:35:59 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2178&amp;PID=8600#8600</guid>
  </item> 
  <item>
   <title>Asynchronous cascading deletes : What is the current recommended...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2178&amp;PID=8587#8587</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=919" rel="nofollow">kpozin</a><br /><strong>Subject:</strong> 2178<br /><strong>Posted:</strong> 21-Sep-2010 at 1:25pm<br /><br />What is the current recommended method for managing asynchronous cascading deletes in Silverlight?<br><br>Has <a href="http://www.ideablade.com/forum/forum_posts.asp?TID=1168#4204" target="_blank">this issue</a> in DevForce 2009 been fixed?<br>]]>
   </description>
   <pubDate>Tue, 21 Sep 2010 13:25:10 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2178&amp;PID=8587#8587</guid>
  </item> 
 </channel>
</rss>