<?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 : Question about entity manager cache</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Question about entity manager cache</description>
  <pubDate>Tue, 21 Apr 2026 14:10:05 -700</pubDate>
  <lastBuildDate>Mon, 07 Jun 2010 20:35:46 -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=1863</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>Question about entity manager cache : A few other thoughts:  For larger...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1863&amp;PID=7193#7193</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=477" rel="nofollow">ting</a><br /><strong>Subject:</strong> 1863<br /><strong>Posted:</strong> 07-Jun-2010 at 8:35pm<br /><br /><DIV>A few other thoughts:</DIV><DIV>&nbsp;</DIV><DIV>For larger applications,&nbsp;we recommend creating a centralized service that returns you an appropriate EntityManager when you ask for one.&nbsp; EntityManager.DefaultManager is an easy way to start off and can take you quite far, but that property doesn't know anything about the business context in which the EntityManager is being used or when it's settings may need to be changed.</DIV><DIV>&nbsp;</DIV><DIV>We don't typically find that passing the EntityManager around to every method to be worthwhile as this just&nbsp;tends to add clutter.</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Mon, 07 Jun 2010 20:35:46 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1863&amp;PID=7193#7193</guid>
  </item> 
  <item>
   <title>Question about entity manager cache :   Originally posted by ehsanHi, I...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1863&amp;PID=7186#7186</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> 1863<br /><strong>Posted:</strong> 07-Jun-2010 at 4:20pm<br /><br /><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by ehsan</strong></em><br /><br />Hi,<div>I want to know if I create many instances of devforce entitymanager (in silverlight 4), each instace will own its cache&nbsp;or all of them will use a shared cache (&amp; may other resources)???</div><div>which&nbsp;one&nbsp;is the best approach ?</div><div>1 - creating only one&nbsp; instance of entitymanager and share it&nbsp;between all classes (it causes coupling !)</div><div>2 - create only one&nbsp; instance of entitymanager and pass it as parameter as any class or method need it (it also causes coupling !)</div><div>3 - create an instance of entitymanager where we need it ?</div></td></tr></table><br><br><br>You can share an EntityManager across your entire application in the same way, and with the same benefits, as when you share a database across an entire application (or multiple applications). Namely, there is one and only one instance of any entity represented in the cache (or database)<br><br>Some developers like to create workspaces (e.g., Customer with associated Orders, OrderDetails, and Products) wherein an end user can make changes and then save or discard only the changes made within that workspace. This is a nice feature, but does complicate development, as you must now figure out how and when you want to reconcile differences between the state of a particular object as represented in Workspace #1 versus Workspace #2. <br><br>For example, the Employee workspace might also have Orders (the ones the Employee wrote), OrderDetails, and Products; so that a given Order, OrderDetail, or Product instance might appear in both the Customer and Employee workspaces. If you make changes to Product X in Workspace #2, should the change be reflected in Product X<br><ol><li>as it appears in Workspace #1 <i>immediately </i>(probably not)? </li><li><i>when the change is saved in Workspace #2 </i>(probably so)? or just </li><li><i>when Product X in Workspace #1 is next updated </i>from the database as a byproduct of some other operation? </li></ol>If your choice is #2 (that it should be updated in Workspace #1 when saved in Workspace #2), you have to write the code to make that happen.<br><br>If you can live without separate workspaces, life is a lot easier. The EntityManager has a static <i>DefaultManager </i>property on it that always returns the same instance of the EntityManager, so you just initialize instances of the EntityManager anywhere in your code by setting them to EntityManager.DefaultManager, and you always get the same EntityManager instance, (and the same cache).<br><br>]]>
   </description>
   <pubDate>Mon, 07 Jun 2010 16:20:12 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1863&amp;PID=7186#7186</guid>
  </item> 
  <item>
   <title>Question about entity manager cache : You are correct. Each EntityManager...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1863&amp;PID=7174#7174</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=23" rel="nofollow">davidklitzke</a><br /><strong>Subject:</strong> 1863<br /><strong>Posted:</strong> 07-Jun-2010 at 11:04am<br /><br /><DIV>You are correct.&nbsp; Each EntityManager has its own separate cache.</DIV><DIV>&nbsp;</DIV><DIV>It is more common and simpler to use a single EntityManager, but this is not necessarily the "best" approach.&nbsp; A lot depends upon your own personal preference.&nbsp; Normally, I would start with a single EntityManager.</DIV>]]>
   </description>
   <pubDate>Mon, 07 Jun 2010 11:04:19 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1863&amp;PID=7174#7174</guid>
  </item> 
  <item>
   <title>Question about entity manager cache : Hi, I want to know if I create...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1863&amp;PID=7162#7162</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=801" rel="nofollow">ehsan</a><br /><strong>Subject:</strong> 1863<br /><strong>Posted:</strong> 06-Jun-2010 at 10:12pm<br /><br />Hi,<DIV>I want to know if I create many instances of devforce entitymanager (in silverlight 4), each instace will own its cache&nbsp;or all of them will use a shared cache (&amp; may other resources)???</DIV><DIV>which&nbsp;one&nbsp;is the best approach ?</DIV><DIV>1 - creating only one&nbsp; instance of entitymanager and share it&nbsp;between all classes (it causes coupling !)</DIV><DIV>2 - create only one&nbsp; instance of entitymanager and pass it as parameter as any class or method need it (it also causes coupling !)</DIV><DIV>3 - create an instance of entitymanager where we need it ?</DIV>]]>
   </description>
   <pubDate>Sun, 06 Jun 2010 22:12:53 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1863&amp;PID=7162#7162</guid>
  </item> 
 </channel>
</rss>