I have a Silverlight 2.0 application using IIS7 and Sql 2008. I'm using ADO.Net Data Services to expose our Entity Framework objects to the SL client. What I am seeing is that on a particular request in my application I initiate a batch request with 4 different service queries; for some reason in certain cases no HTTP request is ever issued (as evidenced from Fiddler). The code does work in many code paths, but I can deterministically cause it to just not issue the HTTP request.
It does not throw an exception or fail the request. I've tried catching all first chance exceptions and nothing seems to be swallowed. I've analyzed the DataServiceContext object in the working and failing state and can't see anything different about it. I have one repro scenario that seems consistent but others are intermittent which made me consider it might be a timing or multi-threaded issue.
The code looks something like this:
var qry1 = from a in _context.A.Expand("B,C")
where a.ID == state
select a;
var qry2 = from d in _context.D
where
d.ExternalID == state
&& d.ChannelID == (int)_channel
select d;
var qry3 = from e in _context.E.Expand("F,B")
where e.CSID == state
select e;
var qry4 = from g in _context.G.Expand("B")
where g.RPID == state
select g;
try
{
IAsyncResult batchRequest = _context.BeginExecuteBatch(
BatchQueryCallback
, state
, qry1 as DataServiceRequest
, qry2 as DataServiceRequest
, qry3 as DataServiceRequest
, qry4 as DataServiceRequest
);
}
catch (Exception e)
{
throw e;
}