New Posts New Posts RSS Feed: Problems with parallel coroutine
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Problems with parallel coroutine

 Post Reply Post Reply
Author
paul.gilbert View Drop Down
Newbie
Newbie
Avatar

Joined: 31-Jan-2012
Location: Australia
Posts: 4
Post Options Post Options   Quote paul.gilbert Quote  Post ReplyReply Direct Link To This Post Topic: Problems with parallel coroutine
    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 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.
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 06-Jun-2012 at 1:20pm
Hi Paul,
 
The article at 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.
 
 
Back to Top
paul.gilbert View Drop Down
Newbie
Newbie
Avatar

Joined: 31-Jan-2012
Location: Australia
Posts: 4
Post Options Post Options   Quote paul.gilbert Quote  Post ReplyReply Direct Link To This Post Posted: 06-Jun-2012 at 10:11pm
Thanks for the reply. That'll at least give me some things to look into.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down