Search found 1 match

by utkuunal
Wed 30 Jun 2021 14:32
Forum: dotConnect Universal
Topic: WaitAll Problem
Replies: 3
Views: 62420

WaitAll Problem

Hello i have been trying to replicate one the examples in the documentation (https://www.devart.com/dotconnect/unive ... onous.html, Synchronization objects part) but for some reason my code never stop at the WaitAll part. I was wondering what is the reason of this problem.

As an additional information WaitAll worked with OracleDataTable (It actually waited).

Here is a part from my code. Im sending a SQL Query that should take 2 min 10 sec

Im using dotConnect Universal 3.80.2402 Standart Edition

myConnections[0] = new UniConnection(conStr);
myCommands[0] = new UniCommand("SELECT DISTINCT * FROM (SELECT T2.* FROM (SELECT * FROM ASGPT_KUTHAY where rownum <4) T1, HAB_KAYIT T2, TENAY T3)", myConnections[0]);
myConnections[1] = new UniConnection(conStr);
myCommands[1] = new UniCommand("SELECT DISTINCT * FROM (SELECT T2.* FROM (SELECT * FROM ASGPT_KUTHAY where rownum <4) T1, HAB_KAYIT T2, TENAY T3)", myConnections[1]);


myConnections[0].Open();
myConnections[1].Open();
aResults[0] = myCommands[0].BeginExecuteReader();
aResults[1] = myCommands[1].BeginExecuteReader();


Console.WriteLine("Waiting for operations to complete...");
bool alldone = WaitHandle.WaitAll(new System.Threading.WaitHandle[] {
aResults[0].AsyncWaitHandle,
aResults[1].AsyncWaitHandle });

var myReader=myCommands[0].EndExecuteReader(aResults[0]);
var myReader1=myCommands[1].EndExecuteReader(aResults[1]);