Page 1 of 1
autoreconnect Feature ??
Posted: 14.04.2007, 11:35
by cokotech
Hello!
Is there any autoreconnect possibility in zeos?
I often have the problem that my mysql server is unaivailabe for a
few seconce and then i get an error message in the Programm.
Bye Sven Lehnert
Posted: 16.04.2007, 08:44
by mdaems
Did you try the TZconnection.ping method? Automatic reconnect on every database access is not available in Zeoslib, however mysql provides the MYSQL_OPT_RECONNECT connection option. We did not provide a way to enable it yet. Would you try to change TZMySQLConnection.Open function to enable it and test? This may do the trick: (NOT TESTED)
Code: Select all
if StrToBoolEx(Info.Values['MYSQL_OPT_RECONNECT']) then
FPlainDriver.SetOptions(FHandle, MYSQL_OPT_RECONNECT, nil);
If this works we can add it to the next release.
When your sever has gone away with open resultsets there's also the brand new Reconnect function which does not close all datasets (as would happen with an disconnect/connect sequence).
MArk