Connection loss when FetchAll = False

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
GuzunNicolae
Posts: 78
Joined: Wed 17 Jan 2007 14:16

Connection loss when FetchAll = False

Post by GuzunNicolae » Mon 22 Jan 2007 17:01

Hello, everybody

Thanks for previous help, but I have one more problem working with MySQL when I set FetchAll=False. I need FetchAll=False cause I have a lot of records.

Now when I want to make a new search with a Query I get 'Connection lost during query' at Query.Close statement. The query is even not executed.

I read about this error on this forum and I can say the following:
- the CommandTimeOut is set to 0 (infinite)
- wait_timeout on the server is 28800
- I use it in LAN, the server is in the same room as my PC. The connection is stable and fast.
- the search is very fast, so it cannot be timeout problem.
- database type is InnoDB, but I don't know for sure. Tell me how to find out this to be sure.

After I get this error and I press F9 the program runs as it should.

This happens only with FetchAll=False

Thanks

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 23 Jan 2007 12:13

If you close a DataSet (TMyQuery, TMyTable) in FetchAll=False mode, the additional connection used to fetch data is killed by the KILL command. This is the reason of the error you are seeing. This is the way to sharply stop data fetch and close this connection. This error message may appear under the debugger, but must not appear without it.

GuzunNicolae
Posts: 78
Joined: Wed 17 Jan 2007 14:16

Post by GuzunNicolae » Tue 23 Jan 2007 14:21

This means there is no problem!!! :D

Thanks a lot!

deca
Posts: 19
Joined: Thu 05 Apr 2007 13:36
Location: Germany

Post by deca » Tue 05 Jun 2007 12:26

Hi,

i have the same "problem" and already know that is only in debugmode, but also there it is very stressful when debug a long time and get permantly the error dialog.

So maybe you can fix this? or is there a workaround without setting fetchall=true

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 05 Jun 2007 12:41

This is a peculiarity of the MyDAC architecture. We will consider possibility to change this in the future.

You can suppress this exception using Debugger Options of your IDE. Just call the corresponding dialog from the Tools IDE menu, and add EMySQLException to the Exception Types to Ignore on the Language Exception tab.

deca
Posts: 19
Joined: Thu 05 Apr 2007 13:36
Location: Germany

Post by deca » Tue 05 Jun 2007 12:59

Thank you for the quick reply,

it works fine.

But now i would get none mysqlerrors, even when it's important, so hoping the future is not as far away :)

Post Reply