<?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 : Clear ClientEdmKey</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Clear ClientEdmKey</description>
  <pubDate>Tue, 28 Apr 2026 22:21:22 -700</pubDate>
  <lastBuildDate>Thu, 25 Aug 2011 12:14:58 -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=2916</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>Clear ClientEdmKey :  I&amp;#039;m validating the calling...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2916&amp;PID=11528#11528</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2916<br /><strong>Posted:</strong> 25-Aug-2011 at 12:14pm<br /><br /><table width="99%"><tr><td class="BBquote"><div><span ="Apple-style-span" style=": rgb251, 251, 253; ">I'm validating the calling assembly, and if it is permitted to have a connection to the database, It will return an instance of the EntityManager with the "Correct" datasourceextension and the calling assembly will have a connection to the database otherwise it can't connect to the database because it doesn't have the correct datasourceextension.</span></div><div><span ="Apple-style-span" style=": rgb251, 251, 253; "></td></tr></table></span></div><div><span ="Apple-style-span" style=": rgb251, 251, 253; "><br></span></div><div>I'm trying to follow what you're thinking here. If the calling assembly is valid, you will return an EntityManager with the correct extension and all is good. If the calling assembly is invalid, you can have 2 options:</div><div><br></div><div>1. Return null in which case, the calling assembly has to handle the logic.</div><div><br></div><div>or</div><div><br></div><div>2. Return an EntityManager with an invalid DataSourceExtension, in which case, the GetKey method should handle the logic by throwing an exception when a bad extension is encountered.</div><div><br></div><div>Does this sound about right?</div><div><br></div><div><table width="99%"><tr><td class="BBquote"></div><div><span ="Apple-style-span" style=": rgb251, 251, 253; "><i><b><u>change that SampleExtension's connectionString to point to VON2\SQL2008R2.</u></b></i></span></div><div><span ="Apple-style-span" style=": rgb251, 251, 253; "><i><b><u><br></u></b></i></span></div><div><span ="Apple-style-span" style=": rgb251, 251, 253; ">How can I do the underlined statement in runtime when it is already resolved?</span></div><div><span ="Apple-style-span" style=": rgb251, 251, 253; "></td></tr></table></span></div><div><span ="Apple-style-span" style=": rgb251, 251, 253; "><br></span></div><div><span ="Apple-style-span" style=": rgb251, 251, 253; ">You can't. Sorry for not being clear on this. I was actually suggesting changing the connectionString before runtime in your tenant database, or your config file or wherever you're storing this information.</span></div><div><span ="Apple-style-span" style=": rgb251, 251, 253; "><br></span></div><div><span ="Apple-style-span" style=": rgb251, 251, 253; "><table width="99%"><tr><td class="BBquote"></span></div><div><span ="Apple-style-span" style=": rgb251, 251, 253; ">how about defining different datasourceextension during Application startup? The idea here is to let the user choose his/her server and database to connect to</span></div><div><span ="Apple-style-span" style=": rgb251, 251, 253; "></td></tr></table></span></div><div><span ="Apple-style-span" style=": rgb251, 251, 253; "><br></span></div><div><span ="Apple-style-span" style=": rgb251, 251, 253; ">It is actually best practice to define multiple DataSourceExtension before runtime, for example in a tenant database or in your config file.</span></div><div><br></div><div>1. Using tenant db -&nbsp;<a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/code-sample-custom-datasourcekeyresolver" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/code-sample-custom-datasourcekeyresolver</a></div><div><br></div><div>or</div><div><br></div><div>2. By defining EdmKey or multiple connectionStrings in your config file -&nbsp;<a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/code-sample-data-source-extensi&#111;ns" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/code-sample-data-source-extensions</a></div><div><br></div><div>If you'd like to define your DataSourceExtension programatically during Application start up, you can do so by accessing the IdeaBladeConfig.Instance. Please see&nbsp;<a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/c&#111;nfigure-programmatically#HSpecifyingdatabasec&#111;nnecti&#111;nsincode" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/configure-programmatically#HSpecifyingdatabaseconnectionsincode</a>&nbsp;for more details.</div>]]>
   </description>
   <pubDate>Thu, 25 Aug 2011 12:14:58 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2916&amp;PID=11528#11528</guid>
  </item> 
  <item>
   <title>Clear ClientEdmKey : Is it possible for you to only...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2916&amp;PID=11519#11519</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1228" rel="nofollow">Vonzkie</a><br /><strong>Subject:</strong> 2916<br /><strong>Posted:</strong> 24-Aug-2011 at 6:52pm<br /><br /><i><b>Is it possible for you to only initialize the EntityManager on those selected assemblies? This is so only selected assembly can access the Model and you never have to worry about validating the assembly.</b></i><div><i><br></i></div><div><i>- </i>What I'm doing is that I have a class project and a static function that validates the calling assemble and returns an instance of an EntityManager.</div><div><br></div><div>E.g. from the calling assembly:</div><div><br></div><div>&nbsp;NorthwindIBEntities context = MyClass.GetNorthwindEntities();</div><div><br></div><div>Now, inside my GetNorthwindEntities function, I'm validating the calling assembly, and if it is permitted to have a connection to the database, It will return an instance of the EntityManager with the "Correct" datasourceextension and the calling assembly will have a connection to the database otherwise it can't connect to the database because it doesn't have the correct datasourceextension.&nbsp;</div><div><br></div><div><i><b>Do you mean that you want to change the SampleExtension's connectionString during runtime? If so, I don't believe this is possible. It wouldn't be a good idea either. You have to define another DataSourceExtension or <u>change that SampleExtension's connectionString to point to VON2\SQL2008R2.</u></b></i></div><div><i><b><u><br></u></b></i></div><div>How can I do the underlined statement in runtime when it is already resolved? Another, what's the drawback of using multiple dynamic datasourceextension? I mean, how about defining different datasourceextension during Application startup? The idea here is to let the user choose his/her server and database to connect to.. Btw., I'm talking about a Windows Form Application in a LAN environment</div><div><i><b><br></b></i></div><div><i><b><br></b></i></div><div><i><br></i></div><div><i><br></i></div><div><br></div><div><br></div>]]>
   </description>
   <pubDate>Wed, 24 Aug 2011 18:52:36 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2916&amp;PID=11519#11519</guid>
  </item> 
  <item>
   <title>Clear ClientEdmKey :  Because I&amp;#039;m validating...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2916&amp;PID=11518#11518</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2916<br /><strong>Posted:</strong> 24-Aug-2011 at 12:34pm<br /><br /><table width="99%"><tr><td class="BBquote"><div><span ="Apple-style-span" style=": rgb251, 251, 253; "><div>Because I'm validating the assembly that initiates the initialization of the EntityManager.</div><div>Only selected assembly should have the right to access the Model, basically for Layering and Security purposes only.</div><div></td></tr></table></div><div><br></div><div>Is it possible for you to only initialize the EntityManager on those selected assemblies? This is so only selected assembly can access the Model and you never have to worry about validating the assembly.</div><div><br></div><div><table width="99%"><tr><td class="BBquote"></div></span><span ="Apple-style-span" style=": rgb251, 251, 253; "><div>Another, since I'm trying to have a dynamic connection to the database (though it doesn't make sense to an n-tier environment), assuming I have a datasourceextension w/c was resolved already but I want to change the underlying connection string. E.g. if&nbsp;<b>SampleExtension&nbsp;</b>has a connection to VON\SQL2008R2 but i want to change it to VON2\SQL2008R2, how can i do that without defining another the datasourceextension?</div><div></td></tr></table></div><div><br></div><div>Do you mean that you want to change the SampleExtension's connectionString during runtime? If so, I don't believe this is possible. It wouldn't be a good idea either. You have to define another DataSourceExtension or change that SampleExtension's connectionString to point to VON2\SQL2008R2.</div></span></div>]]>
   </description>
   <pubDate>Wed, 24 Aug 2011 12:34:50 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2916&amp;PID=11518#11518</guid>
  </item> 
  <item>
   <title>Clear ClientEdmKey : Hi,Another, since I&amp;#039;m trying...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2916&amp;PID=11509#11509</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1228" rel="nofollow">Vonzkie</a><br /><strong>Subject:</strong> 2916<br /><strong>Posted:</strong> 24-Aug-2011 at 1:14am<br /><br />Hi,<div><br></div><div>Another, since I'm trying to have a dynamic connection to the database (though it doesn't make sense to an n-tier environment), assuming I have a datasourceextension w/c was resolved already but I want to change the underlying connection string. E.g. if <b>SampleExtension </b>has a connection to VON\SQL2008R2 but i want to change it to VON2\SQL2008R2, how can i do that without defining another the datasourceextension?</div><div><br></div><div>Thanks,</div><div>Von&nbsp;</div>]]>
   </description>
   <pubDate>Wed, 24 Aug 2011 01:14:16 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2916&amp;PID=11509#11509</guid>
  </item> 
  <item>
   <title>Clear ClientEdmKey : Hi,Because I&amp;#039;m validating...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2916&amp;PID=11507#11507</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1228" rel="nofollow">Vonzkie</a><br /><strong>Subject:</strong> 2916<br /><strong>Posted:</strong> 24-Aug-2011 at 12:44am<br /><br />Hi,<div><br></div><div>Because I'm validating the assembly that initiates the initialization of the EntityManager.</div><div>Only selected assembly should have the right to access the Model, basically for Layering and Security purposes only.</div><div><br></div><div>Thanks,</div><div>Von</div>]]>
   </description>
   <pubDate>Wed, 24 Aug 2011 00:44:24 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2916&amp;PID=11507#11507</guid>
  </item> 
  <item>
   <title>Clear ClientEdmKey : Hi Von;The DataSourceKey caching...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2916&amp;PID=11499#11499</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2916<br /><strong>Posted:</strong> 23-Aug-2011 at 12:36pm<br /><br />Hi Von;<div><br></div><div>The DataSourceKey caching is actually done on purpose for this very reason that the GetKey is not fired everytime if the extension has been resolved. And unfortunately, it seems that the caching is not accessible publicly. Before I give you a workaround, could you explain your use case for this?</div>]]>
   </description>
   <pubDate>Tue, 23 Aug 2011 12:36:51 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2916&amp;PID=11499#11499</guid>
  </item> 
  <item>
   <title>Clear ClientEdmKey : Hi,I have implementedIDataSourceKeyResolverin...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2916&amp;PID=11478#11478</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1228" rel="nofollow">Vonzkie</a><br /><strong>Subject:</strong> 2916<br /><strong>Posted:</strong> 22-Aug-2011 at 1:06am<br /><br />Hi,<div><br></div><div>I have implemented&nbsp;<span ="Apple-style-span" style="font-size: 11px; line-height: normal; "><a href="http://drc.ideablade.com/Api&#068;ocumentati&#111;n/IdeaBlade.EntityModel~IdeaBlade.EntityModel.IDataSourceKeyResolver.html" target="_blank">IDataSourceKeyResolver</a>&nbsp;</span>in my Project to handle dynamic connections.</div><div>However, it seems that there's some cacheing or storing of value going on here and the next time I initialize the same EntityManager with the same extension, the&nbsp;GetKey method is not firing anymore.</div><div><br></div><div>How can I clear the values that might probably stored somewhere, I want the GetKey to be fired&nbsp;every time I initialize &nbsp;an EntityManager.</div><div><br></div><div>Thanks,</div><div>Von&nbsp;</div>]]>
   </description>
   <pubDate>Mon, 22 Aug 2011 01:06:36 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2916&amp;PID=11478#11478</guid>
  </item> 
 </channel>
</rss>