Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy are these asynchronous RIA Service calls executed in serial on the web server?
    primarykey
    data
    text
    <p>I'm calling the RIA Service method <em>ImportSubcomponentFileSetFiles</em> (which is an Invoke, not Query) twice as follows:</p> <pre><code>foreach (var viewModel in FileSetViewModels.Where(vm =&gt; vm.IsSelectedForImport)) { DomainContext.ImportSubcomponentFileSetFiles(viewModel.SubcomponentFileSet.Id, callback =&gt; { //... DomainContext.Load(DomainContext.GetSubcomponentFileSetWithStatusQuery(subcomponentFileSetId), LoadBehavior.RefreshCurrent, callback2 =&gt; { //... }, true); }, null); } </code></pre> <p>I can see in Fiddler that two requests go out to <em>ImportSubcomponentFileSetFiles</em> straight away.</p> <p><em>ImportSubcomponentFileSetFiles</em> takes ~15 seconds to complete. The first call comes back after about 15 seconds and the second call comes back 15 seconds after that. I can see from logging that the second call to <em>ImportSubcomponentFileSetFiles</em> doesn't start until the first call has completed.</p> <p>My question is, why do these asynchronous requests get processed serially on the server and how can I process them in parallel?</p> <p><strong>ADDITIONAL INFORMATION</strong></p> <ul> <li>The WCF Ria Services are hosted in an ASP.NET web application.</li> <li>I'm not storing anything in the session.</li> <li>I'm using Entity Framework 4 in the service method.</li> <li>The Domain Services class extends LinqToEntitiesDomainService&lt;MyObjectContext&gt;</li> </ul> <p>My service method is as follows:</p> <pre><code>public void ImportSubcomponentFileSetFiles(int subcomponentId) { Debug.WriteLine("{0}: {1} - ImportSubcomponentFileSetFiles method started", subcomponentId, DateTime.Now); //...code for fetching subcomponentFileSet subcomponentFileSet.ImportFiles(ObjectContext); Debug.WriteLine("{0}: {1} - ImportSubcomponentFileSetFiles method finished", subcomponentId, DateTime.Now); } </code></pre> <p>Here are my logs detailing the second method call not starting until the first one has finished:</p> <pre><code>File Set A: 27/1/2011 11:20:06 PM 11:20:06 PM - Calling ImportSubcomponentFileSetFiles (Silverlight Client) File Set A: 27/1/2011 11:20:06 PM 11:20:06 PM - ImportSubcomponentFileSetFiles Called (Silverlight Client) File Set B: 27/1/2011 11:20:06 PM 11:20:06 PM - Calling ImportSubcomponentFileSetFiles (Silverlight Client) File Set B: 27/1/2011 11:20:06 PM 11:20:06 PM - ImportSubcomponentFileSetFiles Called (Silverlight Client) File Set A: 01/27/2011 23:20:06 - ImportSubcomponentFileSetFiles method started (Server) File Set A: 01/27/2011 23:20:06 - ImportFiles Started (Server) File Set A: 01/27/2011 23:20:23 - ImportFiles Finished (Server) File Set A: 01/27/2011 23:20:23 - ImportSubcomponentFileSetFiles method finished (Server) File Set A: 27/1/2011 11:20:23 PM - Import callback recieved (Silverlight Client) File Set A: 01/27/2011 23:20:23 - GetSubcomponentFileSetWithStatus Started (Server) File Set A: 01/27/2011 23:20:23 - GetSubcomponentFileSetWithStatus Finished (Server) File Set B: 01/27/2011 23:20:23 - ImportSubcomponentFileSetFiles method started (Server) File Set B: 01/27/2011 23:20:23 - ImportFiles Started (Server) File Set A: 27/1/2011 11:20:23 PM - Refresh callback recieved (Silverlight Client) File Set B: 01/27/2011 23:20:36 - ImportFiles Finished (Server) File Set B: 01/27/2011 23:20:36 - ImportSubcomponentFileSetFiles method finished (Server) File Set B: 27/1/2011 11:20:36 PM - Import callback recieved (Silverlight Client) File Set B: 01/27/2011 23:20:36 - GetSubcomponentFileSetWithStatus Started (Server) File Set B: 01/27/2011 23:20:36 - GetSubcomponentFileSetWithStatus Finished (Server) File Set B: 27/1/2011 11:20:36 PM - Refresh callback recieved (Silverlight Client) </code></pre> <p>Cheers,<br> Chris</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload