mysql5 and zeos 6.6: keep connection alive?

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
baurat
Fresh Boarder
Fresh Boarder
Posts: 10
Joined: 17.04.2006, 16:53

mysql5 and zeos 6.6: keep connection alive?

Post by baurat »

Hi,
I'm reactivating an old databaseproject I did some years ago, now using zeos 6.6.5 and mysql 5 with Delphi 6 prof.
Everything works fine, but after some minutes with no queries or transactions, the mysql connections goes away. Unfortunately I do not find something like a "keep alive" property in ZConnection.

How can I make sure that the connection is still alive even after 15 minutes?

Thanks in advance!
Regards
Heiko
guidoaerts
Senior Boarder
Senior Boarder
Posts: 93
Joined: 01.07.2009, 16:07

Post by guidoaerts »

try setting the option : MYSQL_OPT_CONNECT_TIMEOUT
then there would be something like a persistent connection to mysql, but i dont know if zeos supports it.
guido
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

This property is supported.
conn.Properties.Add('MYSQL_OPT_CONNECT_TIMEOUT=500');
or
conn.Properties.Add('timeout=500');

This probably also depends on the max timeout set on the server!

Mark
Image
Post Reply