autoreconnect Feature ??

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
cokotech
Fresh Boarder
Fresh Boarder
Posts: 15
Joined: 24.03.2007, 12:27

autoreconnect Feature ??

Post 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
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post 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
Post Reply