Blocking Thread soon after TOraQuery.Open

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Horace
Posts: 40
Joined: Thu 11 May 2006 23:37

Blocking Thread soon after TOraQuery.Open

Post by Horace » 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.

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;
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

Horace
Posts: 40
Joined: Thu 11 May 2006 23:37

Post by Horace » Mon 30 Apr 2007 23:26

I forgot to mention that I'm using:
- Delphi v6
- ODAC v5.70.1.34
- MS-Win2003 SP1

However, my friend claims that this is also hapeening on his newer ODAC version.



Horace

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 03 May 2007 11:10

We could not reproduce the problem. Please send to odac*crlab*com a complete small sample that demonstrates the problem, including script to create server objects.

Post Reply