Lost Connection Error
Posted: Wed  22 Jul 2015 14:22
				
				Hi 
I'm having trouble stopping an error message appearing.
I connect to a remote MySQL Server through Securebridge and this appears to work fine.
except a connection is left open and appears to timeout I get the "Lost Connection to MySQL server during query" error, This happens both in the IDE and Outside, having received the error the connection is re established and works fine. its just very annoying.
I have tried - LocalFailover := true
with (RetryMode := TRetryMode(rmReconnectExecute)
or RetryMode := rmReconnectExecute;
But this seems to never be called.
the code I use for connection looks like this :
if not dm3.ScSSHClient.Connected then
dm3.ScSSHClient.Connect;
dm3.MyConnection1.Connect;
DM3.Query1.Close;
DM3.Query1.ParamByName('Location_ID').Value:=LocationID;
DM3.Query1.ParamByName('FromDate').Value:=startoftheday(DateFromDte.date);
DM3.Query1.ParamByName('ToDate').Value:=endoftheday(DateToDte.date);
dm3.Query1.Prepare;
dm3.Query1.Open;
This works fine until a timeout, I would like it just to reconnect behind the scenes. If possible.
Hope you can help
David
			I'm having trouble stopping an error message appearing.
I connect to a remote MySQL Server through Securebridge and this appears to work fine.
except a connection is left open and appears to timeout I get the "Lost Connection to MySQL server during query" error, This happens both in the IDE and Outside, having received the error the connection is re established and works fine. its just very annoying.
I have tried - LocalFailover := true
with (RetryMode := TRetryMode(rmReconnectExecute)
or RetryMode := rmReconnectExecute;
But this seems to never be called.
the code I use for connection looks like this :
if not dm3.ScSSHClient.Connected then
dm3.ScSSHClient.Connect;
dm3.MyConnection1.Connect;
DM3.Query1.Close;
DM3.Query1.ParamByName('Location_ID').Value:=LocationID;
DM3.Query1.ParamByName('FromDate').Value:=startoftheday(DateFromDte.date);
DM3.Query1.ParamByName('ToDate').Value:=endoftheday(DateToDte.date);
dm3.Query1.Prepare;
dm3.Query1.Open;
This works fine until a timeout, I would like it just to reconnect behind the scenes. If possible.
Hope you can help
David