MySQL has gone away

The official tester's forum for ZeosLib 7.1. Ask for help, post proposals or solutions.
Post Reply
Alancj
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 10.01.2017, 21:51

MySQL has gone away

Post 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
Alancj
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 10.01.2017, 21:51

Re: MySQL has gone away

Post by Alancj »

"Solution" found.

I need to issue a Reconnect command when reentering the previous form.
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1934
Joined: 17.01.2011, 14:17

Re: MySQL has gone away

Post 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
Post Reply