TOraQuery Lock Problem

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Samuel

TOraQuery Lock Problem

Post by Samuel » Thu 27 Apr 2006 03:18

I am using ODAC 5.5 with Delphi 7 and Oracle 9i.
My program uses a thread to call a store procedure which will update records in a table. While the thread is executing, I want to show the user the progress, so I use a TOraQuery in the main thread to query the number of records that is done. My OraQuery just contain a select statement. No any update, insert, lock, or delete sql. While I try to open my OraQuery, it holds and waits until the store procedure complete. The procedure really acquires an exclusive lock on the records, but my OraQuery is just a select query, it should be able to open even if the records have an exclusive lock. Could you please help me to solve this problem.

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Thu 27 Apr 2006 08:46

You should use separate sessions for TOraStoredProc and TOraQuery components to avoid blocking of SELECT statement. But Oracle doesn't allow reading of uncommitted records so you should call commit after every insert in your procedure. You can also look at our Progressor demo.

Samuel

Post by Samuel » Fri 28 Apr 2006 02:40

Many thanks, the query can open now. Where can I find the Progressor demo?

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Fri 28 Apr 2006 08:05

ODAC demos can be found in %Delphi installation folder%\Odac\Demos.

Post Reply