[Gambas-user] MySQL connection gone away, how to re-establish?

Alexie ualex73 at ...626...
Fri Sep 6 08:12:10 CEST 2013


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



More information about the User mailing list