MyDAC disconnects after running a number of sequential SELECT queries

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Zumbach
Posts: 1
Joined: Fri 15 Feb 2008 10:39

MyDAC disconnects after running a number of sequential SELECT queries

Post by Zumbach » Fri 15 Feb 2008 10:53

Hello,
I want to read a number of values from MySql database. I define a tree structure in memory and then I fetch all the wanted values from the database using MyDAC. After running a number of loops (as low as 800!), MyDAC disconnects from the MySQL server and the connexion cannot be restablished. I have to wait before rerunning the app because sometimes, even rerunning it quickly gives a ‘desconnected’ error.

I am using:
- Windows XP Professional Version 2002 Service Pack 2
- C++ Builder 2007 CodeGear RAD Studio 2007 version 11.0.2902.10471
- MySQL 4.0.24-nt
- MyDAC version 5.20.0.11 for Delphi 2007

Running this example using the native MySQL API functions it works smoothly, without any disconnection. If I set the MyDAC ‘OnDisconnect’ event, it shoots, so MyDAC detects the disconnection. The problem is that it should not disconnect.

I don’t know if its a problem of MyDAC configuration or it is a basic limitation of the library.

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Re: MyDAC disconnects after running a number of sequential SELECT queries

Post by eduardosic » Fri 15 Feb 2008 16:18

Zumbach wrote:Hello,
I want to read a number of values from MySql database. I define a tree structure in memory and then I fetch all the wanted values from the database using MyDAC. After running a number of loops (as low as 800!), MyDAC disconnects from the MySQL server and the connexion cannot be restablished. I have to wait before rerunning the app because sometimes, even rerunning it quickly gives a ‘desconnected’ error.

I am using:
- Windows XP Professional Version 2002 Service Pack 2
- C++ Builder 2007 CodeGear RAD Studio 2007 version 11.0.2902.10471
- MySQL 4.0.24-nt
- MyDAC version 5.20.0.11 for Delphi 2007

Running this example using the native MySQL API functions it works smoothly, without any disconnection. If I set the MyDAC ‘OnDisconnect’ event, it shoots, so MyDAC detects the disconnection. The problem is that it should not disconnect.

I don’t know if its a problem of MyDAC configuration or it is a basic limitation of the library.
This is a probable winxp bug..

run this reg file in a server and client

save in a fix.reg and run it

-----------------------

Windows Registry Editor Version 5.00


[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
"MaxUserPort"=dword:0000fffe
"TcpTimedWaitDelay"=dword:0000001e

-----------------------

Post Reply