Blocking Thread soon after TOraQuery.Open
Posted: Mon 30 Apr 2007 23:19
Dear Support,
When I block a thread with WaitForSingleObject() or Sleep() , very shortly after executing TOraQuery.Open, then I get an error that the query did not return any rows or other stange access violation errors from the innards of ODAC.
Note: While this thread is waiting, other threads use the same TOraQuery session.
Below is an fragmentary example of the code that causes this error.
If I move the WaitForSingleObject(...) BEFORE the TOraQuery.Open then everything works fine.
Why can't the thread be put into the waitng state soon after executing the TOraQuery.Open method ?
Could you elaborate what is going on inside ODAC ?
What thread context does ODAC execute in, how is the incoming network data buffered, are any APC happening, etc... ?
What remedies do you suggest ? Would NonBlocking mode help?
Regards,
Horace
When I block a thread with WaitForSingleObject() or Sleep() , very shortly after executing TOraQuery.Open, then I get an error that the query did not return any rows or other stange access violation errors from the innards of ODAC.
Note: While this thread is waiting, other threads use the same TOraQuery session.
Below is an fragmentary example of the code that causes this error.
Code: Select all
var
OraQuery : TOraQuery;
begin
OraQuery.OraSQL.Text:=QryStr+' ORDER BY '+SortCols;
OraQuery.Open;
WaitForSingleObject(...) //Used for multithreaded variable R/W locks
v:=FieldByName('ColumName').AsString;Why can't the thread be put into the waitng state soon after executing the TOraQuery.Open method ?
Could you elaborate what is going on inside ODAC ?
What thread context does ODAC execute in, how is the incoming network data buffered, are any APC happening, etc... ?
What remedies do you suggest ? Would NonBlocking mode help?
Regards,
Horace