I think Zeos 7 could benefit enormously by having two very important features.
1. An event that fires when the connection is lost. This is very important in unstable environments like wireless networks.
2. A timeout property for ZConnection. Now with certain DBs (like I'm seeing now with MS SQL on ADO) a Zeos app will hang indefinitely if the connection parameters are invalid. I understand this can be mitigated on certain DBs like My SQL by changing certain properties. But it would be extremely convenient for Zeos to handled this internally.
Two critical new featues
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
cmatrix,
Theire is a way to determine ConnectionLost for MySQL and Oracle(\testing 7.1 (SVN)):
Timeout can be settet too defaults of MySQL:
http://stackoverflow.com/questions/2436 ... n-in-mysql
But you can use
too. See ZDbcMySQL.pas:
Is this answer sufficient?
Theire is a way to determine ConnectionLost for MySQL and Oracle(\testing 7.1 (SVN)):
Code: Select all
if TZConnection.DbcConnection.PingServer = 0 then
//Success
else
//disconnected
...
http://stackoverflow.com/questions/2436 ... n-in-mysql
But you can use
Code: Select all
TZConnection.Properties.Values['timeout'] := '60';
too. See ZDbcMySQL.pas:
Code: Select all
...
ConnectTimeout := StrToIntDef(Info.Values['timeout'], 0);
if ConnectTimeout >= 0 then
GetPlainDriver.SetOptions(FHandle, MYSQL_OPT_CONNECT_TIMEOUT, PAnsiChar(@ConnectTimeout));
...
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
cmatrix,
Any proposals for such an event?
Yes i know Pinging allways is inconvenient. I was thinking about an Improvement with a TThread which can do the job..Pinging the DB server before every data access is very inconvenient. I think an OnLostConnection event would be very useful.
Well i've no idea if it works. Please test it. Again: The MySQL defaults are 2700 secs. If you're more patiant (; little joke...In my experience setting the timeout in .Properties has never worked (in MySQL anyway). I'll try looking into that further.
Any proposals for such an event?
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/