Page 1 of 1

MyDAC disconnects after running a number of sequential SELECT queries

Posted: Fri 15 Feb 2008 10:53
by Zumbach
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.

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

Posted: Fri 15 Feb 2008 16:18
by eduardosic
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

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