<?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 : Multiple EM best practices</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2009 : Multiple EM best practices</description>
  <pubDate>Sat, 02 May 2026 19:01:46 -700</pubDate>
  <lastBuildDate>Fri, 06 Aug 2010 07:51:07 -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=1611</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>Multiple EM best practices :  You have two choices with the...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1611&amp;PID=8020#8020</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> 1611<br /><strong>Posted:</strong> 06-Aug-2010 at 7:51am<br /><br />You have two choices with the save:&nbsp;<div><ol><li>You can tell the EntityManager to save everything that represents a pending change, or&nbsp;</li><li>You can pass it a collection of entities to save.&nbsp;</li></ol></div><div>If you do the latter, it only saves what you pass it. &nbsp;We have no way of knowing, in the case of a limited save, what a developer wants to save or not save. &nbsp;We could cook up an elaborate syntax that would allow you to tell us which related entities to include, and how far out along the chains of associations to go, but it's really easier and surer to give you complete control over the process. You build the collection, we'll save it for you.</div>]]>
   </description>
   <pubDate>Fri, 06 Aug 2010 07:51:07 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1611&amp;PID=8020#8020</guid>
  </item> 
  <item>
   <title>Multiple EM best practices : Hi, understood. But what about...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1611&amp;PID=8015#8015</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=825" rel="nofollow">gkneo</a><br /><strong>Subject:</strong> 1611<br /><strong>Posted:</strong> 05-Aug-2010 at 11:17pm<br /><br /><P>Hi, understood.&nbsp; But what about using the above signature of the async method and sending only the current form's entity instead of having multiple managers?&nbsp;&nbsp; Imagine this entity has 2 navigation properties (one as relatedEntityList).&nbsp; If I add new items to the list and a new instance to the other navigation property, if I use the above method do I only have to send the main entity (and devforce will handle the navigation properties) or do I have to apply some code to look for all the navigation properties that are added/modified for the current entity?</P><DIV>I hope I made myself clear.</DIV><DIV>&nbsp;</DIV><DIV>Regards,</DIV><DIV>&nbsp;</DIV><DIV>Guillermo</DIV>]]>
   </description>
   <pubDate>Thu, 05 Aug 2010 23:17:50 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1611&amp;PID=8015#8015</guid>
  </item> 
  <item>
   <title>Multiple EM best practices : The async methods provided by...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1611&amp;PID=8012#8012</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> 1611<br /><strong>Posted:</strong> 05-Aug-2010 at 5:38pm<br /><br />The async methods provided by DevForce are thread-safe; and there's also no problem with having multiple EntityManagers all launching async queries, saves, and remote service method calls.<div><br></div><div>What you can't do safely -- unless you're very careful -- is to pass a single EntityManager around to separate threads. But again, the provided async methods typically address the use cases that might otherwise tempt developers to do that.</div>]]>
   </description>
   <pubDate>Thu, 05 Aug 2010 17:38:41 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1611&amp;PID=8012#8012</guid>
  </item> 
  <item>
   <title>Multiple EM best practices : Hi!What about using : publicE...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1611&amp;PID=7973#7973</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=825" rel="nofollow">gkneo</a><br /><strong>Subject:</strong> 1611<br /><strong>Posted:</strong> 04-Aug-2010 at 2:57am<br /><br />Hi!<div><br></div><div>What about using :</div><div><span ="Apple-style-span" style="font-family: c&#111;nsolas; white-space: pre; "><span style="color: blue"><table width="99%"><tr><td><pre class="BBcode"></span></span></div><div><span ="Apple-style-span" style="font-family: c&#111;nsolas; white-space: pre; "><span style="color: blue">public</span>&nbsp;<span style="color: #2b91af">EntitySaveOperation</span>&nbsp;SaveChangesAsync(<span style="color: #2b91af">IEnumerable</span>&nbsp;entities,&nbsp;<span style="color: #2b91af">SaveOptions</span>&nbsp;saveOptions&nbsp;=&nbsp;<span style="color: blue">null</span>,&nbsp;<span style="color: #2b91af">Action</span>&lt;<span style="color: #2b91af">EntitySaveOperation</span>&gt;&nbsp;userCallback&nbsp;=&nbsp;<span style="color: blue">null</span>,&nbsp;<span style="color: blue">object</span>&nbsp;userState&nbsp;=&nbsp;<span style="color: blue">null</span>);</span></div><div><font ="Apple-style-span" face="c&#111;nsolas"><span ="Apple-style-span" style="white-space: pre;"></pre></td></tr></table></span></font></div><div><pre style="font-family: c&#111;nsolas"><span ="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; ">So if you have multiple forms for creating/editing entities, you just call the above method with the current form's entity as first parameter (first get the entity into a new list). &nbsp; Is it safe to use or there are other things to consider?</span></pre><pre style="font-family: c&#111;nsolas"><font ="Apple-style-span" face="Verdana, Arial, Helvetica, sans-serif"><span ="Apple-style-span" style="white-space: normal;">Regards,</span></font></pre><pre style="font-family: c&#111;nsolas"><font ="Apple-style-span" face="Verdana, Arial, Helvetica, sans-serif"><span ="Apple-style-span" style="white-space: normal;"><br></span></font></pre><pre style="font-family: c&#111;nsolas"><font ="Apple-style-span" face="Verdana, Arial, Helvetica, sans-serif"><span ="Apple-style-span" style="white-space: normal;">Guilllermo</span></font></pre><pre style="font-family: c&#111;nsolas"><br></pre></div>]]>
   </description>
   <pubDate>Wed, 04 Aug 2010 02:57:29 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1611&amp;PID=7973#7973</guid>
  </item> 
  <item>
   <title>Multiple EM best practices : I saw a mention of something like...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1611&amp;PID=6280#6280</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> 1611<br /><strong>Posted:</strong> 02-Mar-2010 at 10:51pm<br /><br />I saw a mention of something like a "global" Entity Manager and keeping it up to date yourself.<DIV><P><B>Note:</B> The EntityManager is not thread-safe.</P></DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Tue, 02 Mar 2010 22:51:28 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1611&amp;PID=6280#6280</guid>
  </item> 
  <item>
   <title>Multiple EM best practices : That depends on how you write...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1611&amp;PID=6070#6070</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> 1611<br /><strong>Posted:</strong> 11-Jan-2010 at 4:57pm<br /><br />That depends on how you write your code, but assuming you do a reasonable job with that, I wouldn't expect performance to be much affected. If you implement as I described above, then you will have at least twice as many entities in the cache (a local copy + a&nbsp; central copy of each entity) all the time as you otherwise would. But that's a memory footprint issue, not a performance issue. Obviously some extra time will be required for copy entities back and forth between caches. But the forms could see an improvement in performance because they'd always be interacting with a smaller cache than if you were using one cache for all of them. But overall, I wouldn't expect noteworthy change in performance in either direction.<br><br>I think the question should probably hinge more on the balance between the user experience that you want versus the difficulty of coding and maintaining a multi-EM solution versus a single-EM one.<br><br><br>]]>
   </description>
   <pubDate>Mon, 11 Jan 2010 16:57:52 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1611&amp;PID=6070#6070</guid>
  </item> 
  <item>
   <title>Multiple EM best practices : More than one EM is used, Can...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1611&amp;PID=6065#6065</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=45" rel="nofollow">erturkcevik</a><br /><strong>Subject:</strong> 1611<br /><strong>Posted:</strong> 11-Jan-2010 at 1:07pm<br /><br /><DIV><SPAN id=result_ =short_text><SPAN style=": #fff" title="Birden fazla EM kullan&amp;#305;ld&amp;#305;&amp;#287;&amp;#305;nda, perans k&#111;nusunda bilgi verir misiniz?" closure_hashCode_jsmlwi="78"><SPAN id=result_ =medium_text><FONT size=3><SPAN style=": #fff" title="Birden fazla EM kullan&amp;#305;ld&amp;#305;&amp;#287;&amp;#305;nda, perans k&#111;nusunda bilgi verir misiniz?" closure_hashCode_jsmlwi="91">More than one EM is used, Can you give me information about the performance? </SPAN><SPAN style=": #fff" title="Kullan&amp;#305;mda nelere dikkat edilmelidir?" closure_hashCode_jsmlwi="110"><SPAN style=": #ebeff9" title="Kullan&amp;#305;mda perans aç&amp;#305;s&amp;#305;ndan nelere dikkat edilmelidir?" closure_hashCode_jsmlwi="118">What should be observed in use in terms of performance?</SPAN></SPAN></FONT></SPAN></SPAN></SPAN></DIV><DIV><SPAN =short_text><SPAN style=": #fff" title="Birden fazla EM kullan&amp;#305;ld&amp;#305;&amp;#287;&amp;#305;nda, perans k&#111;nusunda bilgi verir misiniz?" closure_hashCode_jsmlwi="78"><SPAN =medium_text><FONT size=3><SPAN style=": #fff" title="Kullan&amp;#305;mda nelere dikkat edilmelidir?" closure_hashCode_jsmlwi="110"><SPAN style=": #ebeff9" title="Kullan&amp;#305;mda perans aç&amp;#305;s&amp;#305;ndan nelere dikkat edilmelidir?" closure_hashCode_jsmlwi="118"></SPAN></SPAN></FONT></SPAN></SPAN></SPAN>&nbsp;</DIV><DIV><SPAN =short_text><SPAN style=": #fff" title="Birden fazla EM kullan&amp;#305;ld&amp;#305;&amp;#287;&amp;#305;nda, perans k&#111;nusunda bilgi verir misiniz?" closure_hashCode_jsmlwi="78"><SPAN =medium_text><FONT size=3><SPAN style=": #fff" title="Kullan&amp;#305;mda nelere dikkat edilmelidir?" closure_hashCode_jsmlwi="110"><SPAN style=": #ebeff9" title="Kullan&amp;#305;mda perans aç&amp;#305;s&amp;#305;ndan nelere dikkat edilmelidir?" closure_hashCode_jsmlwi="118">Regards,</SPAN></SPAN></FONT></SPAN></SPAN></SPAN></DIV><DIV><SPAN =short_text><SPAN style=": #fff" title="Birden fazla EM kullan&amp;#305;ld&amp;#305;&amp;#287;&amp;#305;nda, perans k&#111;nusunda bilgi verir misiniz?" closure_hashCode_jsmlwi="78"><SPAN =medium_text><FONT size=3><SPAN style=": #fff" title="Kullan&amp;#305;mda nelere dikkat edilmelidir?" closure_hashCode_jsmlwi="110"><SPAN style=": #ebeff9" title="Kullan&amp;#305;mda perans aç&amp;#305;s&amp;#305;ndan nelere dikkat edilmelidir?" closure_hashCode_jsmlwi="118"></SPAN></SPAN></FONT></SPAN></SPAN></SPAN>&nbsp;</DIV>]]>
   </description>
   <pubDate>Mon, 11 Jan 2010 13:07:39 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1611&amp;PID=6065#6065</guid>
  </item> 
  <item>
   <title>Multiple EM best practices :  I did a multi-EM solution a...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1611&amp;PID=6048#6048</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> 1611<br /><strong>Posted:</strong> 08-Jan-2010 at 4:24pm<br /><br />I did a multi-EM solution a while back in DevForce Classic, and used a design similar to what you have described. <br><br><ol><li>When an edit form is opened, create a new EM and import the data that you need<br><br>Of course the needed data must first be retrieved into the main EM, then imported from there into the local EM<br><br></li><li>Upon save, import the saved entity back into the global Entity Manager, so the changes can be seen by all. On any other action, simply discard as it is of no use.<br><br>I don't think you would discard it on "any other action"; but rather, when the user explicitly indicated that she wanted to close the form and discard any changes.<br><br>Note also that it's likely to be multiple entities that have been changed and are being saved, so it is those that you would import into the main EM from the local one. Then you would immediately execute a save of all modified, deleted, or new entities in the main EM.<br></li></ol>An additional issue to think about is whether you want individual forms to be notified of changes made (and saved) from other forms. For example, a Customer form and a SalesRep form might both display Orders (those placed by the Customer currently being viewed, and those written by the SalesRep currently being viewed), so you might have the same Order displayed on both forms. If updated in one, do you want the copy in the other to be refreshed with the new values immediately? This gets a little trickier to write, but could be done.<br><br>]]>
   </description>
   <pubDate>Fri, 08 Jan 2010 16:24:02 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1611&amp;PID=6048#6048</guid>
  </item> 
  <item>
   <title>Multiple EM best practices : Since seeing the Billy Hollis...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1611&amp;PID=6045#6045</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=449" rel="nofollow">smi-mark</a><br /><strong>Subject:</strong> 1611<br /><strong>Posted:</strong> 08-Jan-2010 at 9:17am<br /><br />Since seeing the Billy Hollis WPF demo, I have really liked the idea of allowing the customer to have multiple edit forms open at any one time. With a single EM that would be quite dangerous, and impossible to manage.<br><br>What are the best practices for achieving that?<br><br>My thoughts were:<br>- Global EM that contains all the data<br>- When an edit form is opened, create a new EM and import the data that you need<br>- Upon save, import the saved entity back into the global Entity Manager, so the changes can be seen by all. On any other action, simply discard as it is of no use.<br><br>Thanks,<br><br>Mark<br>]]>
   </description>
   <pubDate>Fri, 08 Jan 2010 09:17:29 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1611&amp;PID=6045#6045</guid>
  </item> 
 </channel>
</rss>