Lost connection part 2
most probably network problem
In case of unplug, the switch/router in LAN network may block your IP address even you plug back and have no alarm at network card.
Please try to Ping your PC from others, and whether it works or not.
You can renew your ip by command:
ipconfig all /renew
in Windows
Please try to Ping your PC from others, and whether it works or not.
You can renew your ip by command:
ipconfig all /renew
in Windows
Lost connection to MySQL server during query
In the Help system there are several references to the following:
In the case of exceeding waiting time error CR_SERVER_LOST 'Lost connection to MySQL server during query' raises.
How do I suppress this message
I have set connectiontimeout to 0
In the case of exceeding waiting time error CR_SERVER_LOST 'Lost connection to MySQL server during query' raises.
How do I suppress this message
I have set connectiontimeout to 0
Re: Lost connection to MySQL server during query
Try to increase this valueKL7OR wrote:I have set connectiontimeout to 0
Re: Lost connection to MySQL server during query
Should I set it to a really high value? I thought setting it to 0 was infinate.
Ikar wrote:Try to increase this valueKL7OR wrote:I have set connectiontimeout to 0
I have checked my settings for wait_timeout and it is set to 1800
Ikar wrote:First of all, you should find out what causes the problem. The following can cause the problem:
- Client side: Too small value of TMyConnection.ConnectionTimeout or TCustomMyDataSet.CommandTimeout. To check this hypothesis try to set TCustomMyDataSet.CommandTimeout to 0 (infinitive) and TMyConnection.ConnectionTimeout to 300
- Server side: MySQL server has closed connection. You can read detailed description of all possible reasons in MySQL Reference Manual (http://dev.mysql.com/doc/mysql/en/gone-away.html) but almoust always it is because of too small value of wait_timeout variable. Try to increase it. If this solution is not possible, for example, if you don't have enough rights then you should call MyConnection.Ping with interval less than wait_timeout. Use TTimer in TMyConnection thread for this task.
- Unstable connection (GPRS etc). Use CachedUpdates mode with InnoDB tables. In case of very unstable connection use "disconnected" model by using TSimpleDataSet (TClientDataSet)
In case connection loss MyDAC tries to reconnect, but last command you should repeat again.
MyDAC does not try to reconnect if transaction started or at least one of statements is prepared.
I just want to thank you for all of the excellent support. After a battle with my serviuce provider who insists that wait_timeout is set to 1800 I determined that it was only set to 300 or 5 minutes. I added a ttimer at about 4 and 1/2 minutes to ping, and now my applications is working like it should.
Thanks for the help.
Thanks for the help.
Ikar wrote:First of all, you should find out what causes the problem. The following can cause the problem:
- Client side: Too small value of TMyConnection.ConnectionTimeout or TCustomMyDataSet.CommandTimeout. To check this hypothesis try to set TCustomMyDataSet.CommandTimeout to 0 (infinitive) and TMyConnection.ConnectionTimeout to 300
- Server side: MySQL server has closed connection. You can read detailed description of all possible reasons in MySQL Reference Manual (http://dev.mysql.com/doc/mysql/en/gone-away.html) but almoust always it is because of too small value of wait_timeout variable. Try to increase it. If this solution is not possible, for example, if you don't have enough rights then you should call MyConnection.Ping with interval less than wait_timeout. Use TTimer in TMyConnection thread for this task.
- Unstable connection (GPRS etc). Use CachedUpdates mode with InnoDB tables. In case of very unstable connection use "disconnected" model by using TSimpleDataSet (TClientDataSet)
In case connection loss MyDAC tries to reconnect, but last command you should repeat again.
MyDAC does not try to reconnect if transaction started or at least one of statements is prepared.