So far all the basic operations has worked well.
However, I was trying to test async requests, using a library that can run any number of async requests simultaneously and after all the requests return their values it continues. In this scenario we can save some seconds if we're running 3 queries for example as they will be executed simultaneously.
I've created a very fast query and a very slow one, I request the slow one first and then the fast one. My logs show that they always run synchronously.
So instead of calling executeReaderAsync, I did this:
Code: Select all
IDataReader dataReader = await Task.Run(() =>
cmd.ExecuteReader(CommandBehavior.CloseConnection)
);
So I would like to know if I'm doing something wrong or if the Async was not implemented in this library.
I ask that because I'm not sure if it's because of the "forced async" request I'm making now, but I have a scenario where I have a massive table, and I run 3 queries against it, the first 2 just get a count(*) and the last one gets a datetime field (as many rows as it returns).
The first 2 run fine, but when we get to the last one, it runs the command.ExecuteReader in less than 3 seconds, however, when we get to the reader.Read() it hangs for a VERY long time. I left one running and it took 45 minutes to go through the reader.Read(). It's not persistent though, sometimes after many attempts and actually querying the DB using sqldeveloper (the same query) it "unlocks" and from then on it runs fine. The problem comes back after deployments though.
Have you ever seen behaviour like this, or is there anything I should do or not do? At this moment this is the only thing holding us from buying the product, as async operations are a must for us.