Page 1 of 1

ExecuteReaderAsync not running async

Posted: Thu 10 Aug 2017 01:03
by rmerlin
Hi, we're using dotConnect trial with .net core and running it well in linux docker containers.

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)
);
Now the requests actually run async and even though I've called my fast query for last, it generates its log first than the slow query.

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.

Re: ExecuteReaderAsync not running async

Posted: Fri 11 Aug 2017 17:43
by Shalex
rmerlin wrote:I would like to know if I'm doing something wrong or if the Async was not implemented in this library
You are right: cmd.ExecuteReaderAsync in our provider works like cmd.ExecuteReader (no async). The feature is currenly not supported by dotConnect for Oracle. There is no any timeframe at the moment.
rmerlin wrote: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
Sorry, we cannot explain the behavior you have encountered.