I have code that uses devArt's dotConnect to connect to an Oracle database. It basically looks like this:
using (var context = new MyContext(myConnectionString)
{
var data = (some lync query).ToListAsync();
var data2 = (some lync query).ToListAsync();
etc etc....
await Task.WhenAll(new Task[] {data, data2....});
}
Basically I execute 6 or 7 lync queries asynchronously and wait for them all to end before proceeding. However, when I step through the code, what I'm seeing is that the ToListAsync seems to be running synchronously. Execution does not move to the next line for a second or two (these are big queries). If I just put a breakpoint a the Task.Whenall, VS waits for 10 seconds or so before I hit that breakpoint, and all tasks are completed. Also, in researching this I've found that DBContext is not thread safe so executing mutliple async calls in the same context should be throwing an exception.
So what's going on here? Has anybody seen this in the devArt libraries? Their own support forum is no help.