<?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 : Seeding initial data</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Seeding initial data</description>
  <pubDate>Wed, 13 May 2026 08:27:52 -700</pubDate>
  <lastBuildDate>Sun, 18 Mar 2012 07:37: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=3331</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>Seeding initial data :   Thank you smi-markYou have...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=13019#13019</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=998" rel="nofollow">Walid</a><br /><strong>Subject:</strong> 3331<br /><strong>Posted:</strong> 18-Mar-2012 at 7:37am<br /><br />Thank you smi-mark<div>&nbsp;</div><div>You have shown me the right way... using alternative CompositionContext that didn't use the existing LogniManager gave me a good way to do what I want.</div>]]>
   </description>
   <pubDate>Sun, 18 Mar 2012 07:37:58 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=13019#13019</guid>
  </item> 
  <item>
   <title>Seeding initial data : I&amp;#039;ll let Marcel chime in...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=13018#13018</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> 3331<br /><strong>Posted:</strong> 16-Mar-2012 at 4:00pm<br /><br />I'll let Marcel chime in on this - but one possible option is to use another composition context that does not use the existing LoginManage, you could then use this context on your server manager which bypasses the LoginManager.&nbsp;]]>
   </description>
   <pubDate>Fri, 16 Mar 2012 16:00:07 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=13018#13018</guid>
  </item> 
  <item>
   <title>Seeding initial data :   Thank you for your answers.But...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=13017#13017</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=998" rel="nofollow">Walid</a><br /><strong>Subject:</strong> 3331<br /><strong>Posted:</strong> 16-Mar-2012 at 3:53pm<br /><br />Thank you for your answers.<div>&nbsp;</div><div>But that doesn't meet my needs. I'm trying to&nbsp;expose the problem diiferently : (every thing is executing on the server side)</div><div>&nbsp;</div><div>1- Don't want to allow anonymous login</div><div>2- Need to implement custom authentication =&gt; implementing IEntitiyLoginManager...</div><div>3- Need to make some checks/updates each time application is started =&gt; implementing some actions in Global.asax.cs / <font size="2" face="C&#111;nsolas">Application_Start</font></div><div>But when trying to execute some entity queries on custom manager it tries to login (with my custom login method)</div><div>&nbsp;</div><div>Is there any way to bypass this last process in order to let that entitymanager executing "anonymously" queries ?</div><div>&nbsp;</div><div>Hope I was clearer this time.</div>]]>
   </description>
   <pubDate>Fri, 16 Mar 2012 15:53:00 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=13017#13017</guid>
  </item> 
  <item>
   <title>Seeding initial data : You could allow anonymous login...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=13016#13016</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> 3331<br /><strong>Posted:</strong> 16-Mar-2012 at 3:40pm<br /><br />You could allow anonymous login but then use authorization to control what can be accessed.<br><br>http://drc.ideablade.com/xwiki/bin/view/Documentation/authorize<br><br><br>]]>
   </description>
   <pubDate>Fri, 16 Mar 2012 15:40:21 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=13016#13016</guid>
  </item> 
  <item>
   <title>Seeding initial data :   Walid,The EntityManagers on...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=13015#13015</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3331<br /><strong>Posted:</strong> 16-Mar-2012 at 3:32pm<br /><br />Walid,<div>The EntityManagers on the server that are passed to the LoginManager, Save/QueryInterceptors and server-side methods are special EntityManagers. They look the same, but they behave different because you are on the server and they were created by DF for the purpose. You can't new up one of those server EntityManagers yourself,&nbsp;except by using the copy constructor, which means you first have to get a server EntityManager from somewhere. That means a client has to initiate a request, but a client can't initate a request unless it gets authenticated first or you allow anonymous login. </div>]]>
   </description>
   <pubDate>Fri, 16 Mar 2012 15:32:51 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=13015#13015</guid>
  </item> 
  <item>
   <title>Seeding initial data : I&amp;#039;m not sure I understand...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=13013#13013</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> 3331<br /><strong>Posted:</strong> 16-Mar-2012 at 3:24pm<br /><br />I'm not sure I understand the question - you can always execute a query from the server, with anonymous login enabled or not.]]>
   </description>
   <pubDate>Fri, 16 Mar 2012 15:24:46 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=13013#13013</guid>
  </item> 
  <item>
   <title>Seeding initial data :   Thank you smi-mark.So, my...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=13011#13011</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=998" rel="nofollow">Walid</a><br /><strong>Subject:</strong> 3331<br /><strong>Posted:</strong> 16-Mar-2012 at 3:07pm<br /><br />Thank you smi-mark.<div>&nbsp;</div><div>So, my question is : how to anonymously execute a query server side ? (with allowAnonymousLogin being set to false)</div><div>&nbsp;</div><div>Regards,</div>]]>
   </description>
   <pubDate>Fri, 16 Mar 2012 15:07:24 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=13011#13011</guid>
  </item> 
  <item>
   <title>Seeding initial data : That&amp;#039;s because you are executing...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=12976#12976</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> 3331<br /><strong>Posted:</strong> 13-Mar-2012 at 2:16pm<br /><br />That's because you are executing it on the server. A client cannot execute queries anonymously, but the server manager is not going through the LoginManager.]]>
   </description>
   <pubDate>Tue, 13 Mar 2012 14:16:12 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=12976#12976</guid>
  </item> 
  <item>
   <title>Seeding initial data :    Sorry Marcel but I found...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=12975#12975</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=998" rel="nofollow">Walid</a><br /><strong>Subject:</strong> 3331<br /><strong>Posted:</strong> 13-Mar-2012 at 1:38pm<br /><br />Sorry Marcel but I found a moment when an entityManager doesn't need to be authenticated to execute queries...<div></div><div>That occurs when executing the Login method of an IEntityLoginManager. (Of corse I have set allowAnonymousLogin in the web.config to false.) In that Login method I am supposed to query the database to check the user credentials...</div><div><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"></font></font></font>&nbsp;</div><div><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">public class LoginManager : IEntityLoginManager <br>{<br>&nbsp;public virtual IPrincipal Login(ILoginCredential credential, EntityManager entityManager)<br>&nbsp;&nbsp;{<br>&nbsp;&nbsp;if (credential == null)<br>&nbsp;&nbsp;&nbsp;throw new LoginException(LoginExceptionType.NoCredentials, "Credentials are required.");<br>&nbsp;&nbsp;var myManager = new MyManager(entityManager);<br>&nbsp;&nbsp;//&nbsp;myManager can query/SaveChanges without any authentication !</font></font></div><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"><p><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">I have imagined a static class that verifies the minimal seed data and that can update it if needed, of corse I have made this initialization executed only once, at the first loggin after the server starts...</font></font></p><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"><div></div><p>Regards,</p></font><p></p></font><p></p></font><p></p></font><p></p><span style="font-size:10px"><br /><br />Edited by Walid - 13-Mar-2012 at 1:39pm</span>]]>
   </description>
   <pubDate>Tue, 13 Mar 2012 13:38:32 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=12975#12975</guid>
  </item> 
  <item>
   <title>Seeding initial data : The EntityManager always needs...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=12966#12966</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3331<br /><strong>Posted:</strong> 13-Mar-2012 at 5:06am<br /><br /><P>The EntityManager always needs to be authenticated before running a query. By default, if you don't authenticate the EntityManager yourself, it will automatically attempt to login as anonymous user as part of the first operation. You can disable anonymous access on the server and then the EntityManager will throw an exception if you try to run a query before authenticating. When you use the copy constructor, the authentication context carries over.</P>]]>
   </description>
   <pubDate>Tue, 13 Mar 2012 05:06:49 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=12966#12966</guid>
  </item> 
  <item>
   <title>Seeding initial data :   Thank you Marcel.I have found...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=12964#12964</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=998" rel="nofollow">Walid</a><br /><strong>Subject:</strong> 3331<br /><strong>Posted:</strong> 13-Mar-2012 at 1:29am<br /><br />Thank you Marcel.<div>&nbsp;</div><div>I have found that the EntityManager can execute queries before being authenticated, and thus during the authentication process. Is it a bad idea to use an EntityManager with copyconstructor at this point ? cause it seems to work fine... or maybe is it an unwanted feature or a bug ?</div><div>&nbsp;</div><div>Regards,</div>]]>
   </description>
   <pubDate>Tue, 13 Mar 2012 01:29:41 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=12964#12964</guid>
  </item> 
  <item>
   <title>Seeding initial data :   A trusted server login is...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=12960#12960</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3331<br /><strong>Posted:</strong> 12-Mar-2012 at 7:20pm<br /><br />A trusted server login is generally a bad idea. One never knows where to securely store the credentials. Seeding is normally done once at deployment time, so this sounds like a unique requirement that may need some consulting time to understand better and come up with a suitable approach for your situation.]]>
   </description>
   <pubDate>Mon, 12 Mar 2012 19:20:03 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=12960#12960</guid>
  </item> 
  <item>
   <title>Seeding initial data :   Hello,I want to seed (and...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=12954#12954</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=998" rel="nofollow">Walid</a><br /><strong>Subject:</strong> 3331<br /><strong>Posted:</strong> 11-Mar-2012 at 6:34am<br /><br />Hello,<div>&nbsp;</div><div>I want to seed (and maintain) some data in a silverlight application, let's say, when the server&nbsp;starts (in the Application_Start method for example). I want the seed method to be called only one time, and thus before any user log in the system, so I think I need to have some kind of trusted server login for an EntityManager...</div><div>&nbsp;</div><div>Could you please provide some guidance or best practice for doing that ?</div><div>&nbsp;</div><div>Regards,</div><div>Walid.</div>]]>
   </description>
   <pubDate>Sun, 11 Mar 2012 06:34:18 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3331&amp;PID=12954#12954</guid>
  </item> 
 </channel>
</rss>