Page 1 of 1

TOraQuery Lock Problem

Posted: Thu 27 Apr 2006 03:18
by Samuel
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.

Posted: Thu 27 Apr 2006 08:46
by Challenger
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.

Posted: Fri 28 Apr 2006 02:40
by Samuel
Many thanks, the query can open now. Where can I find the Progressor demo?

Posted: Fri 28 Apr 2006 08:05
by Challenger
ODAC demos can be found in %Delphi installation folder%\Odac\Demos.