[Gambas-user] MySQL connection gone away, how to re-establish?
Benoît Minisini
gambas at ...1...
Fri Sep 6 15:45:28 CEST 2013
Le 06/09/2013 08:12, Alexie a écrit :
> Hi,
>
> We are connection to a MySQL database (on the local machine) and the
> application sometimes runs for days/weeks and numerous select, update,
> delete, etc are going over the connection every hour (so it isn't lack of
> traffic).
>
> We do things like:
>
> rResult = Main.hDB.Exec("UPDATE devices_alex SET value = &1 WHERE
> nodeid = &2", sValue, sAddress)
>
>
> After a while (not easy reproduceable) we get errors like:
> 'Query failed: Lost connection to MySQL server during query'
>
> Is there an easy way of forcing MySQL to reconnect again and retry the
> command? This without adding many-many-many lines of code at each SQL Exec
> statement.
>
> Regards,
> Alex
MySQL automatic reconnection is normally handled automatically by Gambas
for a while. Which version do you use?
--
Benoît Minisini
More information about the User
mailing list