Page 1 of 1

Application using ZEOS (mysql-4.1) takes ages to end

Posted: 01.11.2005, 15:27
by marek
I have the following problem:
Sometimes it takes quite a time (5-10 seconds) for a application to end if it is using ZEOS/mysql41 (I'm using the 6.5.1/July release).

If I close the application, the forms get closed really fast, but I see that
some thread is waiting (somewhere inside ZEOS or the mysql-lib) for some
event, but after several seconds it finally terminates.

This does not happens always... I have some builds that finish fast (1sec)
and some takes ages. (I have no clue, what triggers the delay...)

Where can I look deeper to get the source of this problem?

I tried to close the ZConnection in the OnDestroy handler => no change
I also tried just using ZConnection/ZQuery (without gui releated DB stuff)
but no better results, sometimes it is slow and sometimes not.

Any clues? BTW, I'm using a server on localhost, so I assume no network-lag...

Regards
Marek

Posted: 01.11.2005, 16:09
by marek
I found a "quick hack" solution after searching on the mysql buglist.

Adding WSACleanup to my finalization part of the program fixed the delay.

I hope I get no negative side effects with that hack, because I never initialized it.

Regards
Marek

Posted: 05.11.2005, 19:06
by zippo
Can you explain more detailed?

Posted: 05.11.2005, 19:14
by marek
Sorry,
but I have no clue, what should be explained in more detail?

Posted: 06.11.2005, 13:28
by zippo
How you implemented the usage of "WSACleanup". Could be a silly question, but I'm a newbie.. :)

Posted: 06.11.2005, 14:49
by marek
uses winsock;

[...]

initialization
finalization
WSACleanup;
end.

Posted: 09.11.2005, 09:33
by zippo
ahh, so easy... I tought it was about DLL functions calling.. :) Thank you!