Avoid table locking

Avoid table locking

Postby Hanne Berthelsen » Thu 19 May 2005 11:19

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
Hanne Berthelsen
 
Posts: 15
Joined: Thu 18 Nov 2004 07:51

Postby Ikar » Thu 19 May 2005 11:22

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.
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56


Return to MySQL Data Access Components