Problem with FetchAll and updates

Problem with FetchAll and updates

Postby lsc82 » Tue 21 Dec 2004 17:37

Hi,

I'm using D5, MyDac 3.1.13 and MySQL 4.0.20a

I'm experiencing 2 problems:

- First, I've

1 TMyConnection
1 TMyQuery
1 TMyTable

I'm in edit mode of the tmytable object, with some edit component bounded. After some hours if I click OK to save changes I have a "Connection lost during query" error.

- Second, and last

1 TMyConnection

several TMyQuery of several tables in database
(all query are very simple, of type "select * from table where")

several TMyTable of several tables in database

Than I've to do some operation such as delete and insert, modify, update on some of this tables.
When I've to make an update I create a TMyCommand and than free it.

Using FetchAll = True, I've no problem, all insert, modify and update works perfectly

Using FetchAll = False, I've the problem that operations stop at the updates (mysql doesn't receive the command).

The 3.0.x component freeze, but the 3.1.13 component after a while says "Lost connection during query"

I need Fetchall = False, to work with grid of large query (select * from table).

Thanks

Lsc82
lsc82
 

Postby Ikar » Wed 22 Dec 2004 08:00

> - First, I've

We reproduced your problem and fixed it. This fix will be included in the next MyDAC build. It will be available in about two days.


> - Second, and last

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