<?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 : InvokeServerMethodAsync - threading problems?</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : InvokeServerMethodAsync - threading problems?</description>
  <pubDate>Wed, 15 Apr 2026 18:00:41 -700</pubDate>
  <lastBuildDate>Mon, 13 Jun 2011 11:55:41 -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=2750</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>InvokeServerMethodAsync - threading problems? : Hi danjal;Could you post some...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2750&amp;PID=10961#10961</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> 2750<br /><strong>Posted:</strong> 13-Jun-2011 at 11:55am<br /><br />Hi danjal;<div><br></div><div>Could you post some code snippets of your InvokeServerMethod logic on the client?</div>]]>
   </description>
   <pubDate>Mon, 13 Jun 2011 11:55:41 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2750&amp;PID=10961#10961</guid>
  </item> 
  <item>
   <title>InvokeServerMethodAsync - threading problems? : I have a datagrid that contains...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2750&amp;PID=10919#10919</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=946" rel="nofollow">danjal</a><br /><strong>Subject:</strong> 2750<br /><strong>Posted:</strong> 09-Jun-2011 at 9:59am<br /><br /><P style="MARGIN: 0cm 0cm 10pt" ="Ms&#111;normal"><SPAN style="mso-ansi-: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri>I have a datagrid that contains some data.<?: prefix = o ns = "urn:schemas-microsoft-com:office:office" /><O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0cm 0cm 10pt" ="Ms&#111;normal"><SPAN style="mso-ansi-: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri>In this grid, there is an expand button. When the user clicks this button a nested grid appears, with data that belongs to the specific row.<O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0cm 0cm 10pt" ="Ms&#111;normal"><SPAN style="mso-ansi-: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri>The data for the nested grid come from a <B style="mso-bidi-font-weight: normal">InvokeServerMethodAsync</B> call that is called the first time the user hits this expand button. This works fine.<O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0cm 0cm 10pt" ="Ms&#111;normal"><SPAN style="mso-ansi-: EN-US" lang=EN-US><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0cm 0cm 10pt" ="Ms&#111;normal"><SPAN style="mso-ansi-: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri>Then I added a refresh functionality to the grid, that when used, refetches the data for the master grid and calls InvokeServerMethodAsync for the nested grids. This is where I get an error, which I think has something to do with the fact that I am calling the same InvokeServerMethodAsync many times within a short time frame.<O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0cm 0cm 10pt" ="Ms&#111;normal"><SPAN style="mso-ansi-: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri>But why is this a problem?<O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0cm 0cm 10pt" ="Ms&#111;normal"><SPAN style="mso-ansi-: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri>We are using Silverlight DevForce 6.0.9<O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0cm 0cm 0pt" ="Ms&#111;normal"><SPAN style="COLOR: red; mso-ansi-: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri>Message: System.InvalidOperationException: An EntityManager can only execute on a single thread. This EntityManager is authorized to execute on the thread with id=’1’; the requested operation came from the thread with Id=‘53’. Consider calling the EntityManager’s asynchronous methods; they work safely on background threads managed by DevForce. <SPAN style="mso-spacerun: yes">&nbsp;</SPAN>You may have to disable this cross-thread checking for specific reasons such as automated testing. Please review our documentation on multi-threading issues and the EntityManager.AuthorizedThreadId property.</P><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp; at IdeaBlade.EntityModel.EntityQueriedEventArgs.get_Results()<BR>&nbsp;&nbsp; at IdeaBlade.EntityModel.EntityQueryOperation.get_Results()<BR>&nbsp;&nbsp; at IdeaBlade.EntityModel.ListEntityReference`1.QueryCallback(EntityQueryOperation op)<BR>&nbsp;&nbsp; at IdeaBlade.EntityModel.BaseOperation`2.OnCompleted()<BR>&nbsp;&nbsp; at IdeaBlade.EntityModel.BaseOperation`2.IdeaBlade.EntityModel.IHasAsyncEventArgs.OnCompleted()<BR>&nbsp;&nbsp; at IdeaBlade.EntityModel.AsyncProcessor`1.&lt;&gt;c__DisplayClass2.&lt;.ctor&gt;b__0(TArgs args)<BR>&nbsp;&nbsp; at IdeaBlade.EntityModel.AsyncProcessor`1.Signal()<BR>&nbsp;&nbsp; at IdeaBlade.EntityModel.AsyncProcessor`1.&lt;CheckPreActionHasError&gt;b__6(Object d)<BR>&nbsp;&nbsp; at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)<BR>&nbsp;&nbsp; at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)<BR>&nbsp;&nbsp; at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()<BR>&nbsp;&nbsp; at System.Threading.ThreadPoolWorkQueue.Dispatch()<BR>&nbsp;&nbsp; at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()&nbsp;&nbsp;&nbsp; <O:P></O:P></DIV></FONT></FONT></SPAN><P style="MARGIN: 0cm 0cm 10pt" ="Ms&#111;normal"><SPAN style="mso-ansi-: EN-US" lang=EN-US><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><span style="font-size:10px"><br /><br />Edited by danjal - 09-Jun-2011 at 10:02am</span>]]>
   </description>
   <pubDate>Thu, 09 Jun 2011 09:59:09 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2750&amp;PID=10919#10919</guid>
  </item> 
 </channel>
</rss>