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.
MyDAC disconnects after running a number of sequential SELECT queries
-
eduardosic
- Posts: 387
- Joined: Fri 18 Nov 2005 00:26
- Location: Brazil
Re: MyDAC disconnects after running a number of sequential SELECT queries
This is a probable winxp bug..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.
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
-----------------------