Page 1 of 1

Avoid table locking

Posted: Thu 19 May 2005 11:19
by Hanne Berthelsen
How do I avoid table being locked when opening a query (TMyQuery->Open) ?

I have two applications using the same table - the table cannot be used by second application when first application runs a query to generate a report (QuickReport).

What should be selected for TMyConnection or TMyQuery to avoid the locking ?

Regards Hanne

Posted: Thu 19 May 2005 11:22
by Ikar
The problem occurs because of locking MyISAM tables. If you try to
update underfetched table MySQL waits while it will be completely fetched.
Please refer to MySQL Reference manual 5.3 Locking Issues for details.
To avoid the problem you can use any of following solutions.
- set FetchAll to True;
- change type of the table into, for example, InnoDB.