Lost connection part 2

Lost connection part 2

Postby 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
solata
 
Posts: 12
Joined: Tue 12 Jul 2005 07:29

Postby 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.
GEswin
 
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain

Postby 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...
solata
 
Posts: 12
Joined: Tue 12 Jul 2005 07:29

Postby 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
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Postby 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
solata
 
Posts: 12
Joined: Tue 12 Jul 2005 07:29

Postby Ikar » Wed 31 Aug 2005 12:30

Try to set MyConnection.Server in IP-form:

MyConnection.Server := '192.168.0.100';
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Postby 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
GEswin
 
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain

Postby 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;
solata
 
Posts: 12
Joined: Tue 12 Jul 2005 07:29

Postby 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.
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Lost Connection

Postby 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
Guest
 

Postby GEswin » Fri 02 Sep 2005 08:30

Close & Reopen connection.
GEswin
 
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain

Postby 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.
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Lost connection

Postby 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.
KL7OR
 
Posts: 6
Joined: Mon 24 Jan 2005 00:41

Postby Ikar » Thu 08 Sep 2005 07:59

Have you succeeded in finding problem source? Is it on Client or Server side? Or on network?
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Postby GEswin » Thu 08 Sep 2005 09:02

Try also setting TMyConnection.Direct to True/False and see if you got different behaviour.
GEswin
 
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain

Next

Return to MySQL Data Access Components