I've read all previous posts on setting timeout variables on server.
I made test project and put on form MyConnection and Button click I create simple LMyQuery. Server interactive_timeout and wait_timeout are set to 10 sec.
Button click executes well till 10 sec. Ater 10 sec and 1st click I get lost connection error. MyConnection.Connected is still True. The next click is ok.
Code: Select all
procedure TForm1.BitBtn3Click(Sender: TObject);
var
LMyQuery: TMyQuery;
LQuery: string;
begin
LMyQuery := TMyQuery.Create(nil);
try
LMyQuery.Connection := MyConnection1;
LQuery := 'select * from table1';
LMyQuery.SQL.Text := LQuery;
LMyQuery.Open;
ShowMessage('OK');
finally
LMyQuery.Close;
FreeAndNil(LMyQuery);
end;
end;
BTW. Setting timeout to huge number is not acceptable solution and MyConnection1.Ping does not help.