FetchAll=False & Lost connection again

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Fri 09 Nov 2007 16:20

Yes, we reproduced it. This is a restriction of the LocalFailover functionality. Failover does not occur and the OnConnectionLost event is not raised if there are underfetched datasets withing the connection. So this is designed behaviour when Failover does not occur on connection lost when fetching data in FetchAll=False mode.

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

ok..

Post by eduardosic » Fri 09 Nov 2007 17:49

Antaeus wrote:Yes, we reproduced it. This is a restriction of the LocalFailover functionality. Failover does not occur and the OnConnectionLost event is not raised if there are underfetched datasets withing the connection. So this is designed behaviour when Failover does not occur on connection lost when fetching data in FetchAll=False mode.
ok,, the solution for GuzunNicolae is increase a value of MySQL Variables..
or put a TTime calling TMyConnection.Ping;


Antaeus, exists a possibilit to create in TmyConnection.Options 2 new properties:

AutoPing = True/False
AutoPingInterval = Integer

to call ping automatically and reactive a connection?


best regard's, Eduardo.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Mon 12 Nov 2007 09:00

We will think about these properties. Probably we will add them in the next MyDAC builds\versions, but it is hardly to happen in the near time.
Meanwhile you can implement a procedure that pings the MySQL server by yourself.

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

ok..

Post by eduardosic » Mon 12 Nov 2007 10:04

Antaeus wrote:We will think about these properties. Probably we will add them in the next MyDAC builds\versions, but it is hardly to happen in the near time.
Meanwhile you can implement a procedure that pings the MySQL server by yourself.
Currently i use the DisconnectedModel/LocalFailOver and I do not have more problem with Lostconnection. the ideia of the property and for who still does not use the DisconnectedModel/LocalFailover.

thank's for MyDAC, the best Data Access for MySQL.

GuzunNicolae
Posts: 78
Joined: Wed 17 Jan 2007 14:16

Post by GuzunNicolae » Tue 13 Nov 2007 11:56

Antaeus wrote:Yes, we reproduced it. This is a restriction of the LocalFailover functionality. Failover does not occur and the OnConnectionLost event is not raised if there are underfetched datasets withing the connection. So this is designed behaviour when Failover does not occur on connection lost when fetching data in FetchAll=False mode.
Ok. This is the problem that the OnConnectionLost is not triggered. But why it is looses connection? With FetchAll = True everything works perfect.

eduardosic wrote: ok,, the solution for GuzunNicolae is increase a value of MySQL Variables..
or put a TTime calling TMyConnection.Ping;
Thank you eduardosic for your help.
But the idea is that the main connection does not stay idle for more than 2-3 sec. And it closes exactly at the same time the new data are to be fetched.
Only the additional connection (created to fetch data as I guess) is closed. And for sure pinging from the main connection will not help. We don't have any access to the second connection.

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

lostconnection..

Post by eduardosic » Tue 13 Nov 2007 13:31

GuzunNicolae wrote:
Antaeus wrote:Yes, we reproduced it. This is a restriction of the LocalFailover functionality. Failover does not occur and the OnConnectionLost event is not raised if there are underfetched datasets withing the connection. So this is designed behaviour when Failover does not occur on connection lost when fetching data in FetchAll=False mode.
Ok. This is the problem that the OnConnectionLost is not triggered. But why it is looses connection? With FetchAll = True everything works perfect.

eduardosic wrote: ok,, the solution for GuzunNicolae is increase a value of MySQL Variables..
or put a TTime calling TMyConnection.Ping;
Thank you eduardosic for your help.
But the idea is that the main connection does not stay idle for more than 2-3 sec. And it closes exactly at the same time the new data are to be fetched.
Only the additional connection (created to fetch data as I guess) is closed. And for sure pinging from the main connection will not help. We don't have any access to the second connection.
LostConnection to happen for some reasons:

1 - Unstable network
2 - timeout of all variables below

try to increase the value

connect_timeout | 5 |
| delayed_insert_timeout | 300 |
| innodb_lock_wait_timeout | 50 |
| interactive_timeout | 28800 |
| net_read_timeout | 30 |
| net_write_timeout | 60 |
| slave_net_timeout | 3600 |
| sync_replication_timeout | 10 |
| table_lock_wait_timeout | 50 |
| wait_timeout | 28800

GuzunNicolae
Posts: 78
Joined: Wed 17 Jan 2007 14:16

Re: lostconnection..

Post by GuzunNicolae » Thu 22 Nov 2007 10:55

I have finally could restart my mysql server.
So I have changed
net_read_timeout
net_write_timeout

to some bigger values and this solved the problem.

Thank you very much

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Re: lostconnection..

Post by eduardosic » Thu 22 Nov 2007 10:59

GuzunNicolae wrote:I have finally could restart my mysql server.
So I have changed
net_read_timeout
net_write_timeout

to some bigger values and this solved the problem.

Thank you very much
Very Good!!!

:D

Post Reply