Page 1 of 1

MySQL has gone away

Posted: 24.11.2017, 02:29
by Alancj
I'm just starting with Zeoslib components. I've run into something that, from the research I've done, shouldn't be happening. None of the homework I've done references the issue we're having.
A form is opened and all queries execute correctly. However, when I open another form from that form, and then return, I get "MySQL has gone away".
I've set up a timer to check the ZConnection is still connected. All tests say that ZConnection1 is still connected.
I've also changed the max_allowed_packet to 64M and wait_timeout to 36000 in My.ini. No change.

The query in question is:
with FCGlobalQu do
begin
Close;
SQL.Clear;
SQL.Add('select * from fcglobal where coycode =:iCoyCode');
ParamByName('iCoyCode').AsInteger := StrToInt(sActCoy);
Open;
end;
The error is triggered on "open". That query is run when the form first opens. It needs to run again to make sure the updated contents of fcglobal are available.

Any ideas would be appreciated.

Thanks.

Alan

Re: MySQL has gone away

Posted: 26.11.2017, 23:35
by Alancj
"Solution" found.

I need to issue a Reconnect command when reentering the previous form.

Re: MySQL has gone away

Posted: 27.11.2017, 12:31
by marsupilami
Hello Alancj,

the "MySQL server has gone away" message usually means thet the server has dropped the connection for some reason. This is nothung, Zeos can manage. There are several posts on stackoverflow about this issue, some suggestiong modifications of timeouts.

With best regards,

Jan