Hi,
I used Delphi 5 Ent, MyDAC v3.30.2.15
One of my table contained over than 10000 records
When I open it using TmyTable by setting properties
TItem.FetchAll := False;
TItem.open;
Open is ok, then I used
TItem.Edit;
TItem.Fieldbyname('weight').value := 10;
TItem.Post;
The error appeared : "Lost connection to MySQL server during query"
But if my table contained less than few hundreds, then is error wont appeared.
Is this a bugs? Or I have to aware about using FetchAll or else where?
Thanks!
Edit record on TmyTable FetchAll=False problem
Re: Edit record on TmyTable FetchAll=False problem
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.
To avoid the problem you can use any of following solutions.
- set FetchAll to True;
- change type of the table into, for example, InnoDB.