Problem: I'm working on a Silverlight application, and I'm loading lots of data into a DomainContext, i.e. from a Web Service. It starts off running a few different queries, with BusyIndicator displaying the current query, but when it gets to the query with the most data, it freezes. After a few minutes it says that the server doesn't respond to the next query.
Debug/attempted solutions: The system works when I load less data. I assume that it times out, and that is why it says that the next query doesn't exist, i.e. it can't even contact the web service. I looked around for a while, and people suggested increasing timeout and max result size. These have solved other issues, so I know they work (i.e. that they are being applied), but it doesn't solve this problem.
I tried isolating the problem to make sure that it wasn't some other silly problem that had nothing to do with loading the data. The problems occurs when returning from the query function in the web service (return result; below), i.e. there shouldn't be a problem with the web service itself. So both the debug prints are executed, and the second one says 2726 elements.
Web service code:
public IQueryable<Person> GetPeopleWithSubscription()
{
Debug.WriteLine("Before");
IQueryable<Person> result = test();
Debug.WriteLine("After " + result.Count().ToString());
return result;
}
private IQueryable<Person> test()
{
return this.ObjectContext.People.Where(p =>
p.Subscriptions.Count > 0 ||
p.Subscriptions1.Count > 0 ||
p.ID < 0);
}
Calling code:
...
_context.Load(_context.GetSubscriptionTypesQuery(), DataLoaded, false);
...
Also, the problem appears to be on the client side, because an old client (i.e. before the problem occurred) still works with the new server. However, I've been going through the diffs in the repository from since the problem occurred, and I can't find anything that should make a difference (not saying it isn't there).
Can anyone help me with this problem? If you need more information, please let me know.