<?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 : Concurrency handling and EntitiesWithErrors is null</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2009 : Concurrency handling and EntitiesWithErrors is null</description>
  <pubDate>Thu, 16 Apr 2026 14:37:57 -700</pubDate>
  <lastBuildDate>Thu, 25 Sep 2008 23:42: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=945</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>Concurrency handling and EntitiesWithErrors is null : Sure Greg, I shall do this over...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=945&amp;PID=3438#3438</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=370" rel="nofollow">sebma</a><br /><strong>Subject:</strong> 945<br /><strong>Posted:</strong> 25-Sep-2008 at 11:42pm<br /><br />Sure Greg, I shall do this over the weekend ;-)]]>
   </description>
   <pubDate>Thu, 25 Sep 2008 23:42:34 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=945&amp;PID=3438#3438</guid>
  </item> 
  <item>
   <title>Concurrency handling and EntitiesWithErrors is null : Sebastian, I did the following:  1....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=945&amp;PID=3437#3437</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> 945<br /><strong>Posted:</strong> 25-Sep-2008 at 2:58pm<br /><br /><DIV>Sebastian, I did the following:</DIV><DIV>&nbsp;</DIV><DIV>1. Took your version of ConcurrencyHandler.cs and plopped it into the Completed Solution from the concurrency Learning Unit in the product&nbsp;release;</DIV><DIV>2.&nbsp;Changed the namespace back to "UI";</DIV><DIV>3. Compiled the app successfully;</DIV><DIV>4. Set a breakpoint just inside the <FONT size=2>HandleConcurrencyException() method;</FONT></DIV><DIV>5. Ran two copies of the app (one by double-clicking the UI.exe executable);</DIV><DIV>6. Opened the Employee tab in both instances of the app to load the Employee data;</DIV><DIV>7. Changed Nancy Davolio's first name in the instance run by double-clicking UI.exe, and saved the change;</DIV><DIV>8. Changed Nancy's first name in the instance launched from inside Visual Studio, and attempted to save that, resulting in a concurrency exception;</DIV><DIV>9. At the breakpoint in HandleConcurrencyException, examined pException.EntitiesWithErrors&#091;0&#093; and found Nancy Davolio there.</DIV><DIV>&nbsp;</DIV><DIV>So, I am unable to reproduce the problem.</DIV><DIV>&nbsp;</DIV><DIV>Can you do the steps above with the *unchanged* Completed Solution with the Learning Unit and tell me if you get a different result?</DIV><DIV>&nbsp;</DIV><DIV>Thanks,</DIV><DIV>Greg</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Thu, 25 Sep 2008 14:58:36 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=945&amp;PID=3437#3437</guid>
  </item> 
  <item>
   <title>Concurrency handling and EntitiesWithErrors is null : Hi Greg,  I zipped my associated...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=945&amp;PID=3431#3431</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=370" rel="nofollow">sebma</a><br /><strong>Subject:</strong> 945<br /><strong>Posted:</strong> 25-Sep-2008 at 8:32am<br /><br />Hi Greg,<br /><br />I zipped my associated files in attachment, not sure if they make any sense without the complete VS solution. <br /><br />I was merely duplicating the codes from "Program Files\IdeaBlade DevForce EF\Learning Units\200 Intermediate\030 Handling Concurrency Conflicts\02 Code CSharp\Completed Solution".<br /><br />Thanks<br />-Sebastian<a href="uploads/370/C&#111;ncurrency_Files.zip" target="_blank">Concurrency_Files.zip</a>]]>
   </description>
   <pubDate>Thu, 25 Sep 2008 08:32:37 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=945&amp;PID=3431#3431</guid>
  </item> 
  <item>
   <title>Concurrency handling and EntitiesWithErrors is null : Sebastian:  Using the current...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=945&amp;PID=3429#3429</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> 945<br /><strong>Posted:</strong> 24-Sep-2008 at 5:45pm<br /><br /><DIV>Sebastian:</DIV><DIV>&nbsp;</DIV><DIV>Using the current release version of DevForce EF (4.2.0) and the concurrency tutorial from that, I am unable to reproduce your problem. My pException.EntitiesWithErrors&#091;0&#093; contains the entity involved in the conflict.</DIV><DIV>&nbsp;</DIV><DIV>I notice that your code is a bit different from that in the concurrency learning unit that accompanies the 4.2.0 release. Where did it come from?</DIV><DIV>&nbsp;</DIV><DIV>Greg Dunn</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 24 Sep 2008 17:45:23 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=945&amp;PID=3429#3429</guid>
  </item> 
  <item>
   <title>Concurrency handling and EntitiesWithErrors is null : Looking into this...back soon....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=945&amp;PID=3427#3427</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> 945<br /><strong>Posted:</strong> 23-Sep-2008 at 2:01pm<br /><br />Looking into this...back soon.]]>
   </description>
   <pubDate>Tue, 23 Sep 2008 14:01:29 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=945&amp;PID=3427#3427</guid>
  </item> 
  <item>
   <title>Concurrency handling and EntitiesWithErrors is null : I followed the learning units...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=945&amp;PID=3413#3413</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=370" rel="nofollow">sebma</a><br /><strong>Subject:</strong> 945<br /><strong>Posted:</strong> 22-Sep-2008 at 2:20am<br /><br />I followed the learning units on handling concurrency and having an AutoIncrement RowVersion columns and BaseEntity etc., and it works. A EntityManagerSaveException is now thrown when there is a concurrency conflict.<br /><br />However, I do not know why the inner exception's EntitiesWithErrors is always null, as in the TODO codes below :-(<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public static ConflictScenario HandleConcurrencyException(DomainModelEntityManager pEntityManager, EntityManagerSaveException pException, ConcurrencyResolutionStyle pResolutionStyle)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StringBuilder msg = new StringBuilder();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (pResolutionStyle == ConcurrencyResolutionStyle.JustReportTheViolation)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine("A concurrency error occurred while saving your data." + "\n" + "\n" + " Someone probably saved their changes while you were making your changes." + "\n" + "\n");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return ConflictScenario.NotDiscriminated;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// TODO: pException.EntitiesWithErrors is null<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;Entity entityWithError = pException.EntitiesWithErrors&#091;0&#093;;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;switch (pResolutionStyle)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case ConcurrencyResolutionStyle.DatabaseVersionWins:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return KeepDatabaseChanges(pEntityManager, entityWithError);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case ConcurrencyResolutionStyle.LocalVersionWins:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return KeepMyChanges(pEntityManager, entityWithError);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case ConcurrencyResolutionStyle.ResolveConflicts:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return ResolveMyConflicts(pEntityManager, entityWithError);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return ConflictScenario.NotDiscriminated;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br /><br />Thanks and best regards<br />-Sebastian]]>
   </description>
   <pubDate>Mon, 22 Sep 2008 02:20:06 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=945&amp;PID=3413#3413</guid>
  </item> 
 </channel>
</rss>