Print Page | Close Window

Problems with parallel coroutine

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3483
Printed Date: 04-Jun-2025 at 12:58am


Topic: Problems with parallel coroutine
Posted By: paul.gilbert
Subject: Problems with parallel coroutine
Date Posted: 06-Jun-2012 at 3:19am
Hello,

I have a problem with my Silverlight 4 application that needs to load various lists at startup. Pretty much what http://drc.ideablade.com/xwiki/bin/view/Documentation/parallel-async-coroutines - http://drc.ideablade.com/xwiki/bin/view/Documentation/parallel-async-coroutines describes. I created a coroutine method with a series of 'yield return' calls to ExecuteAsync, and none of them use data returned by any of the others. I then launch the method by calling Coroutine.StartParallel.

Despite following the example, my startup code still seems to take a long time. Doing analysis, I put some debugging information into the client on the entities Querying/Queried, as well as in a stub server query interceptor ExecuteQuery method  (before and after a call to the .base.ExecuteQuery). The resulting debug information seems to indicate that, on my system, although the 'Query' event gets called for all of them at once, the query interceptor is getting called for each query one at a time, and the 'Queried' on the client is being fired between each, which would seem to mean that the server is processing them synchronously, despite the client having launched them using a parallel coroutine.

I was able to verify with Fiddler that the EntityServer.svc is getting called multiple times all at once (for all the queries), so I'm wondering if there's a setting for the server side DevForce code that controls the number of allowed concurrent connections from the client? Could that be what's preventing the queries from being run concurrently server side?


On a related note, I've been trying to reduce the complexity of the queries so they individually execute faster, and was I was wondering about a few cases where I have an inheritance hierarchy in the EDMX, which is represented as a table per class (which I have no choice about). So there is, for example, a class/table defining fields that are wanted on a particular business object, and a series of descendant class/tables for each of half a dozen supported field types.

Is there any way to do a query that could get just the items (or even a specific item) of a specific descendant type, rather than having the default SQL being generated which tries to join together all the child tables? If for example I only wanted a list of all the 'text' field objects, and didn't care about other types. I've tried using OfType<TextField>() in the queries, but this doesn't have any effect on the generated SQL.

Thanks.



Replies:
Posted By: sbelini
Date Posted: 06-Jun-2012 at 1:20pm
Hi Paul,
 
The article at http://blogs.imeta.co.uk/jyoung/archive/2010/04/08/849.aspx - http://blogs.imeta.co.uk/jyoung/archive/2010/04/08/849.aspx  points to some possible causes to the issue you have described:
- browser number of connections allowed
- Client Http Stack
- ASP.Net Session State
 
The article above also details how to deal with each of the situations mentioned.
 
In addition to that, you might want to disable the ASP.NET compatibility flag in the web.config if not using it.
 
Regards,
   Silvio.
 
 


Posted By: paul.gilbert
Date Posted: 06-Jun-2012 at 10:11pm
Thanks for the reply. That'll at least give me some things to look into.



Print Page | Close Window