<?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 : Error with Multiple Instances of EntityQueryPagedCollectionView</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Error with Multiple Instances of EntityQueryPagedCollectionView</description>
  <pubDate>Mon, 13 Apr 2026 18:51:56 -700</pubDate>
  <lastBuildDate>Fri, 03 Sep 2010 13:46:45 -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=2116</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>Error with Multiple Instances of EntityQueryPagedCollectionView : Remember to instantiate each new...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2116&amp;PID=8357#8357</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=482" rel="nofollow">WardBell</a><br /><strong>Subject:</strong> 2116<br /><strong>Posted:</strong> 03-Sep-2010 at 1:46pm<br /><br />Remember to instantiate each new EntityManager using the prior one so that you can carry over the authentication information from one EM to the next.&nbsp; For example:<DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;<FONT face="Courier New, Courier, mono">var aNewManager = new NorthwindEntitiesManager(existingManager);</FONT></DIV><DIV>&nbsp;</DIV><DIV>The other way to do this - a way that ONLY associates the managers by authentication - and perhaps the preferred way&nbsp;these days - is:&nbsp; </DIV><DIV>&nbsp;</DIV><DIV><FONT face="Courier New, Courier, mono">&nbsp; var aNewManager = new NorthwindEntitiesManager();</FONT></DIV><DIV><FONT face="Courier New, Courier, mono">&nbsp; aNewManager.LinkForAuthentication(existingManager);</FONT></DIV><DIV><BR>Merely writing "<FONT face="Courier New, Courier, mono">new NorthwindEntitiesManager()</FONT>" will cause the new manager to login when used. You might not notice if you haven't implemented a LoginManager but you'll be thrashing the login process.</DIV><DIV>&nbsp;</DIV><DIV>I often keep a root EntityManager in a safe place just so I can mint new EntityManagers.</DIV>]]>
   </description>
   <pubDate>Fri, 03 Sep 2010 13:46:45 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2116&amp;PID=8357#8357</guid>
  </item> 
  <item>
   <title>Error with Multiple Instances of EntityQueryPagedCollectionView : Thanks for the work around. I...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2116&amp;PID=8339#8339</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=902" rel="nofollow">EisenbergEffect</a><br /><strong>Subject:</strong> 2116<br /><strong>Posted:</strong> 03-Sep-2010 at 9:13am<br /><br />Thanks for the work around. I just confirmed that that will work for us.]]>
   </description>
   <pubDate>Fri, 03 Sep 2010 09:13:58 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2116&amp;PID=8339#8339</guid>
  </item> 
  <item>
   <title>Error with Multiple Instances of EntityQueryPagedCollectionView : This is a bug in the EntityQueryPagedCollectionView....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2116&amp;PID=8338#8338</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 2116<br /><strong>Posted:</strong> 03-Sep-2010 at 9:07am<br /><br />This is a bug in the EntityQueryPagedCollectionView.&nbsp; When it creates a query for a page it uses the page number as the "UserState" for the async query for tracking purposes.&nbsp; The internal tracking for async queries done via the EntityManager disallows using the same UserState twice at one time, so because you're using two EntityQueryPagedCollectionView instances with one EntityManager you've run into the problem.&nbsp; We'll add a bug report to fix this.&nbsp; The workaround for now would be to use a separate EntityManager with each EQPCV.]]>
   </description>
   <pubDate>Fri, 03 Sep 2010 09:07:32 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2116&amp;PID=8338#8338</guid>
  </item> 
  <item>
   <title>Error with Multiple Instances of EntityQueryPagedCollectionView : The code is pretty simple. I am...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2116&amp;PID=8336#8336</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=902" rel="nofollow">EisenbergEffect</a><br /><strong>Subject:</strong> 2116<br /><strong>Posted:</strong> 03-Sep-2010 at 7:51am<br /><br />The code is pretty simple. I am not actually executing the queries myself. That is being done by the&nbsp;<span ="Apple-style-span" style="line-height: 15px; font-size: 11px; -webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><strong>EntityQueryPagedCollectionView</strong></span><div><br></div><div><br></div><div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var query = manager.AdmissionApplications</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.Where(x =&gt; x.Review.Status.IsInitialStatus &amp;&amp; x.IsSubmitted)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.OrderBy(x =&gt; x.SubmittedAt)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.Include(x =&gt; x.PersonalInformation)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.Include(x =&gt; x.PersonalInformation.Account)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.Include(x =&gt; x.Requirements)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.Include("Requirements.Requirement");</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Applications = new EntityQueryPagedCollectionView(</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(EntityQuery)query,</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PageSize</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;);</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var query2 = manager.Inquiries</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.Where(x =&gt; x.IsSubmitted &amp;&amp; x.Status == InquiryStatus.New)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.OrderBy(x =&gt; x.SubmittedAt)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.Include(x =&gt; x.PersonalInformation);</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Inquiries = new EntityQueryPagedCollectionView(</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(EntityQuery)query2,</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PageSize</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;);</div></div><div><br></div><div>In this case, both Applications and Inquiries are instances of&nbsp;<span ="Apple-style-span" style="line-height: 15px; font-size: 11px; -webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><strong>EntityQueryPagedCollectionView.</strong>&nbsp;This code causes the above error to occur. As far as I can tell, there is no way to set the UserState since I am not directly executing the queries. Is this a bug in the CollectionView or am I missing something entirely?</span></div>]]>
   </description>
   <pubDate>Fri, 03 Sep 2010 07:51:51 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2116&amp;PID=8336#8336</guid>
  </item> 
  <item>
   <title>Error with Multiple Instances of EntityQueryPagedCollectionView : Hi Rob - Going to need a little...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2116&amp;PID=8330#8330</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=482" rel="nofollow">WardBell</a><br /><strong>Subject:</strong> 2116<br /><strong>Posted:</strong> 02-Sep-2010 at 7:25pm<br /><br /><P>Hi Rob - Going to need a little more than this to understand the issue.</P><DIV></DIV><DIV>Btw, there is one "UserState" object for the entire task chain ... and you supply it as an optional argument to Execute when you kick off the task chain.</DIV><DIV>&nbsp;</DIV><DIV>I'm sorry this is not well documented. In fact, the entire section on it is missing from the DRC (DevForce Resource Center). It was never that great to begin with but we want to fill the gap soon.</DIV><DIV>&nbsp;</DIV><DIV>So, Rob, can you show us some code :-)</DIV>]]>
   </description>
   <pubDate>Thu, 02 Sep 2010 19:25:48 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2116&amp;PID=8330#8330</guid>
  </item> 
  <item>
   <title>Error with Multiple Instances of EntityQueryPagedCollectionView : Where? I can&amp;#039;t see where...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2116&amp;PID=8326#8326</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=902" rel="nofollow">EisenbergEffect</a><br /><strong>Subject:</strong> 2116<br /><strong>Posted:</strong> 02-Sep-2010 at 11:28am<br /><br />Where? I can't see where to assign such a value.]]>
   </description>
   <pubDate>Thu, 02 Sep 2010 11:28:04 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2116&amp;PID=8326#8326</guid>
  </item> 
  <item>
   <title>Error with Multiple Instances of EntityQueryPagedCollectionView : Are you currently using a userstate?...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2116&amp;PID=8325#8325</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> 2116<br /><strong>Posted:</strong> 02-Sep-2010 at 11:27am<br /><br />Are you currently using a userstate? If not, why not just throw in a Guid.NewGuid() as the userstate?&nbsp;]]>
   </description>
   <pubDate>Thu, 02 Sep 2010 11:27:07 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2116&amp;PID=8325#8325</guid>
  </item> 
  <item>
   <title>Error with Multiple Instances of EntityQueryPagedCollectionView :  We are trying to use two instances...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2116&amp;PID=8323#8323</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=902" rel="nofollow">EisenbergEffect</a><br /><strong>Subject:</strong> 2116<br /><strong>Posted:</strong> 02-Sep-2010 at 9:13am<br /><br />We are trying to use two instances of&nbsp;EntityQueryPagedCollectionView simultaneously. There appears to be an internal problem with this related to the queries not having different UserState values. Is there any way to work around this? Below is a screen cap of our error dialog:<div><br></div><div><img src="uploads/902/EntityQueryPagedCollecti&#111;nViewError.jpg" height="394" width="499" border="0" /><br></div><span style="font-size:10px"><br /><br />Edited by EisenbergEffect - 03-Sep-2010 at 9:14am</span>]]>
   </description>
   <pubDate>Thu, 02 Sep 2010 09:13:55 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2116&amp;PID=8323#8323</guid>
  </item> 
 </channel>
</rss>