MySQL has gone away

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

MySQL has gone away

Postby Alancj » 24.11.2017, 02:29

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

Postby Alancj » 26.11.2017, 23:35

"Solution" found.

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

marsupilami
Gold Boarder
Gold Boarder
Posts: 673
Joined: 17.01.2011, 14:17

Re: MySQL has gone away

Postby marsupilami » 27.11.2017, 12:31

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


Return to “ZeosLib 7.1 stable Forum”

Who is online

Users browsing this forum: No registered users and 0 guests