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

Bruce bbruen at ...2308...
Fri Sep 6 08:19:04 CEST 2013


On Fri, 2013-09-06 at 08:12 +0200, Alexie wrote:
> 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

There was a discussion of this in the forums a while ago.  It might help
to search the forum archives.

(Sorry I can't be more specific - I avoid MySQL like the plague!)
Bruce





More information about the User mailing list