Lost connection part 2

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
solata
Posts: 12
Joined: Tue 12 Jul 2005 07:29

Lost connection part 2

Post by solata » Wed 31 Aug 2005 10:51

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

GEswin
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain
Contact:

Post by GEswin » Wed 31 Aug 2005 11:33

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.

solata
Posts: 12
Joined: Tue 12 Jul 2005 07:29

Post by solata » Wed 31 Aug 2005 11:54

Look its not network, computer or server problem...
App must run 24/7.

Problem is easy repeatable. Just run program thah connects to database (over net). Execute some query. Than disconect and reconect your local network cable. And execute query again...

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Wed 31 Aug 2005 12:08

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

solata
Posts: 12
Joined: Tue 12 Jul 2005 07:29

Post by solata » Wed 31 Aug 2005 12:20

Delphi 7 sp1
MyDAC 3.55.0.22
MySQL server version: 4.0.24-max-log
MySQL client version: 4.1.3 Direct

S

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Wed 31 Aug 2005 12:30

Try to set MyConnection.Server in IP-form:

MyConnection.Server := '192.168.0.100';

GEswin
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain
Contact:

Post by GEswin » Wed 31 Aug 2005 13:40

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

solata
Posts: 12
Joined: Tue 12 Jul 2005 07:29

Post by solata » Thu 01 Sep 2005 07:27

Ok, I have subquestion:

Why this jumps over except block, if server is not accesable:

Code: Select all

try
  MyConnection1.Ping;
except
end;

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Thu 01 Sep 2005 11:55

So far Ping just sends a packet to server without result analyzing.
In MyDAC 4.00.1.3 and subsequent this behavior will be improved.

Guest

Lost Connection

Post by Guest » Fri 02 Sep 2005 03:45

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

GEswin
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain
Contact:

Post by GEswin » Fri 02 Sep 2005 08:30

Close & Reopen connection.

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Fri 02 Sep 2005 11:39

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.

KL7OR
Posts: 6
Joined: Mon 24 Jan 2005 00:41

Lost connection

Post by KL7OR » Wed 07 Sep 2005 19:09

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.

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Thu 08 Sep 2005 07:59

Have you succeeded in finding problem source? Is it on Client or Server side? Or on network?

GEswin
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain
Contact:

Post by GEswin » Thu 08 Sep 2005 09:02

Try also setting TMyConnection.Direct to True/False and see if you got different behaviour.

Post Reply