Lost Connection after 8 hour no activity on my PC

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Daniel Fagnan
Posts: 58
Joined: Fri 13 Oct 2006 00:08

Lost Connection after 8 hour no activity on my PC

Post by Daniel Fagnan » Wed 28 Feb 2007 00:19

I Used a touch screen Pc with a connection to mySQL server
After long time of inactivity 6 hour and more

The first guy who try to punch i lost this transaction the other guy is Ok
I think after long time I should reconnect this exactly the same then the first guy, this guy reconnect the connection to my Sql and other guy
arrive and the connection is Ok.

How to be alert for the PC never lost connection to SQL Server
I want then the PC connection was up

swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Post by swierzbicki » Wed 28 Feb 2007 11:12

Create a thread that will ping the server each 20 sec

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

my.ini

Post by eduardosic » Wed 28 Feb 2007 22:47

swierzbicki wrote:Create a thread that will ping the server each 20 sec
try increase value of variables in my.ini


connect_timeout = 31536000
interactive_timeout = 31536000
wait_timeout = 31536000
net_read_timeout = 31536000
net_write_timeout = 31536000
slave_net_timeout = 31536000
max_connections = 31536000
max_user_connections = 31536000

look in mySQL help for this variables.

swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Post by swierzbicki » Thu 01 Mar 2007 16:50

Hi Edoardosic,

Would it not be "dangerous" to increase the values ? For example what will happens if you lost your connection and that a transaction / lock are active ?

Thank you !

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

no...

Post by eduardosic » Thu 01 Mar 2007 23:12

swierzbicki wrote:Hi Edoardosic,

Would it not be "dangerous" to increase the values ? For example what will happens if you lost your connection and that a transaction / lock are active ?

Thank you !
I find that he is not dangerous, when the connection is closed mysql executes one automatically rollback if transactions are active.

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

Post by Antaeus » Fri 02 Mar 2007 13:46

In order to avoid wasting server resourses when the client is inactive for a long time, you can use the Disconnected Model of MyDAC 5. It allows disconnecting automatically after an interaction to the server is finished.

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

Disconnected Model, very very Good.

Post by eduardosic » Fri 02 Mar 2007 15:08

Antaeus wrote:In order to avoid wasting server resourses when the client is inactive for a long time, you can use the Disconnected Model of MyDAC 5. It allows disconnecting automatically after an interaction to the server is finished.
Disconnected Model is a very important tecnology, congratulations Antaeus.

Daniel Fagnan
Posts: 58
Joined: Fri 13 Oct 2006 00:08

With Ping in thread all is Ok

Post by Daniel Fagnan » Mon 05 Mar 2007 13:58

If Ping at 20 sec. all is Ok

Thank you

But the disconnect model of version 5.0 should be better! Why?
What's is the disconnect model someone can refer me to
explication of disconnect model and why many people wait after this features lot of people talk about it in this forum. :D

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

Post by Antaeus » Mon 05 Mar 2007 17:13

You can read more about Disconnected Mode in the "Working with Disconnected Mode" article of the last MyDAC 5 build.

Post Reply