Anyone who knows how to make persistent connections with the zeos db components for Delphi 7?
Everything works fine with queries, except that the connection times out/dies after about 8-10 seconds. Any workaround for this?
Delphi 7 - Lost connection (timeout)
Moderators: gto, cipto_kh, EgonHugeist
I have a sort like problem.
Is winxp sp2 installed on this system ?
if the build-in firewall is activated there's a maximum of 10 connections for 1 app. Because I do loads of query's within a couple of seconds my program gets very slow or sometimes trows messages like " Mysql Lost connection (timeout)"
anyone a solution
Nico
Is winxp sp2 installed on this system ?
if the build-in firewall is activated there's a maximum of 10 connections for 1 app. Because I do loads of query's within a couple of seconds my program gets very slow or sometimes trows messages like " Mysql Lost connection (timeout)"
anyone a solution
Nico
hi,
in my experiance this is a general issue with the mysql-server, which cuts off connections if they are idle for a specific time and other clients are waiting to get a connection. You have to know that the server only allows a specific amount of connections from all clients, which is by default at 100 I think. So fx if you have the 70's connection to the server, there can also come up to 30 additional connections without any interference. If then come even more clients requesting a connection, the server has to decide what to do: block each new connection as long as noone of the 100 hasn't closed the connection or have a look at idle connections from the 100 and throw them away. The last behaviour can be seen on many servers.
The good thing is that you get automatically re-connected with almost all connection parameters without being prompted again for username or so. In ZeosLib I only find it hard to restore the last Database-property - I always get these issues in this order:
1. login with your ZConnection and fire: "USE dbname1"
2. be idle for a specific amount of seconds/minutes
3. fire some sql on a table
4. SQL error: "Lost connection to mysql server"
5. automatically getting re-connected
6. fire some sql-statement like "select * from sometable"
7. SQL error: "No database selected"
The last error is quite logical, as only the connection gets restored, but not the last used database. But it's a big question how to avoid this last query? There is no fired event of ZConnection which indicates the re-connection, I tried all these: BeforeConnect, BeforeDisconnect, AfterConnect, AfterDisconnect, OnLogin - not one of these is fired in a case of re-connection, so it's impossible to react internally on the disconnect. Anyone has an idea?
Greetings,
Anse
P.S.: HeidiSQL 3.0 RC1 will be released this week!
in my experiance this is a general issue with the mysql-server, which cuts off connections if they are idle for a specific time and other clients are waiting to get a connection. You have to know that the server only allows a specific amount of connections from all clients, which is by default at 100 I think. So fx if you have the 70's connection to the server, there can also come up to 30 additional connections without any interference. If then come even more clients requesting a connection, the server has to decide what to do: block each new connection as long as noone of the 100 hasn't closed the connection or have a look at idle connections from the 100 and throw them away. The last behaviour can be seen on many servers.
The good thing is that you get automatically re-connected with almost all connection parameters without being prompted again for username or so. In ZeosLib I only find it hard to restore the last Database-property - I always get these issues in this order:
1. login with your ZConnection and fire: "USE dbname1"
2. be idle for a specific amount of seconds/minutes
3. fire some sql on a table
4. SQL error: "Lost connection to mysql server"
5. automatically getting re-connected
6. fire some sql-statement like "select * from sometable"
7. SQL error: "No database selected"
The last error is quite logical, as only the connection gets restored, but not the last used database. But it's a big question how to avoid this last query? There is no fired event of ZConnection which indicates the re-connection, I tried all these: BeforeConnect, BeforeDisconnect, AfterConnect, AfterDisconnect, OnLogin - not one of these is fired in a case of re-connection, so it's impossible to react internally on the disconnect. Anyone has an idea?
Greetings,
Anse
P.S.: HeidiSQL 3.0 RC1 will be released this week!
Yupieeeee!
About connection lost - you can tweak the parameters on MySQL server. I can't remember the parameters names, but if you need it i'll search.
About anse123 problem. I think the reconnection is based on the properties of the component. Try to check in which database you're in before doing the 6. point on the list.
About connection lost - you can tweak the parameters on MySQL server. I can't remember the parameters names, but if you need it i'll search.
About anse123 problem. I think the reconnection is based on the properties of the component. Try to check in which database you're in before doing the 6. point on the list.
If the mysql is installed on an winxp-sp2 machine it allows only 10 incoming connections (this isn't an issue of the mysql, but pure from winxp).
If i run my program localhost only, it works great.
On google there are many tweaks to find for this winxp-sp2 problem, but none seems to work for me.
( http://www.speedguide.net/read_articles.php?id=1497 )
Passing the Zconnection between several application-files (exe, dll, dll, etc etc) would be a solution for me.
But zeos starts to trow vage av's when I try to do that.
(probably because of : http://seegernet.koolhost.de/zeosforum/ ... .php?t=429 )
If i run my program localhost only, it works great.
On google there are many tweaks to find for this winxp-sp2 problem, but none seems to work for me.
( http://www.speedguide.net/read_articles.php?id=1497 )
Passing the Zconnection between several application-files (exe, dll, dll, etc etc) would be a solution for me.
But zeos starts to trow vage av's when I try to do that.
(probably because of : http://seegernet.koolhost.de/zeosforum/ ... .php?t=429 )
-
- Junior Boarder
- Posts: 29
- Joined: 31.10.2005, 00:09
- Location: Antwerp
- Contact:
Could you specify me the parameters? I'm experiencing the same problem.zippo wrote:Yupieeeee!
About connection lost - you can tweak the parameters on MySQL server. I can't remember the parameters names, but if you need it i'll search.
About anse123 problem. I think the reconnection is based on the properties of the component. Try to check in which database you're in before doing the 6. point on the list.