Auto disconnect problem

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
tcflam
Posts: 62
Joined: Tue 01 Jan 2013 10:48

Auto disconnect problem

Post by tcflam » Wed 26 Mar 2014 01:49

Hi,

I'm using version 5.2.5. When I use SSH connection, it will auto disconnect when idling. Why? How can I solve it with auto disconnect?

Thanks!

tcflam
Posts: 62
Joined: Tue 01 Jan 2013 10:48

Re: Auto disconnect problem

Post by tcflam » Wed 26 Mar 2014 01:51

I provide the error message as below.

"Project XXXX raised exception class EMySqlException with message 'Lost connection to MySQL server during query. Error on data reading from the connection: Socket Error Code : 10053($2745)"

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: Auto disconnect problem

Post by Dimon » Wed 26 Mar 2014 16:50

To solve the problem try to increase the values of the following variables in the my.ini file:
connect_timeout = 31536000
interactive_timeout = 31536000
wait_timeout = 31536000
net_read_timeout = 31536000
net_write_timeout = 31536000
slave_net_timeout = 31536000

tcflam
Posts: 62
Joined: Tue 01 Jan 2013 10:48

Re: Auto disconnect problem

Post by tcflam » Fri 28 Mar 2014 06:13

Hi, can this setting solve the disconnect problem when idling? I'm using raise exception handle for reconnect. Which once is better, is your solution or my solution?
Thanks!

PavloP
Devart Team
Posts: 149
Joined: Fri 24 Jan 2014 12:33

Re: Auto disconnect problem

Post by PavloP » Tue 01 Apr 2014 12:55

These two solutions may be used simultaneously and do not interfere with each other.

By changing variables in my.ini, you change behavior of MySQL server. This has an impact on how long the server will wait for the connection confirmation before breaking it.

Usage of exception handle allows to process possible cases of connection break, which may not depend on server, but on the network condition.

Post Reply