Lost connection part 2
Lost connection part 2
Hi! I dont mean to call names but I am not satisfied with components!
Problem is connected to the previous post I wrote a few days ago.
My app is running on PC and connects to database on other PC. Network is reset (everything is as previous). App freazes on next read/write to database. I get a bunch of exeptions from MyConnection. It doesnt reconect.
MyConnection (MyQuery) does not reconect! Even Ping doesnt help.
Are you going to solve this problem in near future?
S
Problem is connected to the previous post I wrote a few days ago.
My app is running on PC and connects to database on other PC. Network is reset (everything is as previous). App freazes on next read/write to database. I get a bunch of exeptions from MyConnection. It doesnt reconect.
MyConnection (MyQuery) does not reconect! Even Ping doesnt help.
Are you going to solve this problem in near future?
S
Perhaps you should check other things like server, network itself etc.. I'm using mydac since more than 1 year, and didn't have almost any problem. I would also recommend trying to use TMyConnection.Direct set to False or True to see if you get any change.
If you detail some more of the settings, hardware, lan setup etc perhaps someone can help you a little bit more. I found at one install that some app was killing server and causing lost connection, or some faulty switch or bad connected network.
If you detail some more of the settings, hardware, lan setup etc perhaps someone can help you a little bit more. I found at one install that some app was killing server and causing lost connection, or some faulty switch or bad connected network.
We couldn't reproduce the problem.
Please supply us following information.
- Exact version of Delphi, C++ Builder or Kylix
- Exact version of MyDAC. You can see it in About sheet of TMyConnection Editor
- Exact version of MySQL server and MySQL client.
You can see it in Info sheet of TMyConnection Editor
Please supply us following information.
- Exact version of Delphi, C++ Builder or Kylix
- Exact version of MyDAC. You can see it in About sheet of TMyConnection Editor
- Exact version of MySQL server and MySQL client.
You can see it in Info sheet of TMyConnection Editor
I neither have this problem, if i unplug cable and plug back everything works fine. I have many appz running 24h/day, fax servers, sms servers, appz that interacts with penpads driven over gprs, multi-thread app that work with wireless barcode readers, etc. Try to detail a little bit more info to see if we can see what's wrong. Also OS, firewall, etc.
Regards
Regards
Ok, I have subquestion:
Why this jumps over except block, if server is not accesable:
Why this jumps over except block, if server is not accesable:
Code: Select all
try
MyConnection1.Ping;
except
end;
Lost Connection
I am using mydac 3.10.2.8 with delphi 5 Mysql is running on a windows server 1200 miles away.
I am getting killed with lost connection issues and do not know how to reset the connection in code
I am getting killed with lost connection issues and do not know how to reset the connection in code
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.
- 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.
Lost connection
I am still having problems with lost connection issues.
Can someone please supply me with some sample code to trap and re-establish my connection.
My users are very unhappy.
Can someone please supply me with some sample code to trap and re-establish my connection.
My users are very unhappy.