Two critical new featues

The official tester's forum for ZeosLib 7.1. Ask for help, post proposals or solutions.
cmatrix
Junior Boarder
Junior Boarder
Posts: 29
Joined: 20.10.2005, 21:43
Contact:

Two critical new featues

Postby cmatrix » 05.06.2013, 14:19

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.

User avatar
EgonHugeist
Zeos Dev Team
Zeos Dev Team
Posts: 1739
Joined: 31.03.2011, 22:38

Postby EgonHugeist » 06.06.2013, 13:13

cmatrix,

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
...

Timeout can be settet too defaults of MySQL:
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));
...


Is this answer sufficient?
King regards, Michael

You want to help? viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image

cmatrix
Junior Boarder
Junior Boarder
Posts: 29
Joined: 20.10.2005, 21:43
Contact:

Postby cmatrix » 06.06.2013, 14:01

Pinging the DB server before every data access is very inconvenient. I think an OnLostConnection event would be very useful.

In my experience setting the timeout in .Properties has never worked (in MySQL anyway). I'll try looking into that further.

User avatar
EgonHugeist
Zeos Dev Team
Zeos Dev Team
Posts: 1739
Joined: 31.03.2011, 22:38

Postby EgonHugeist » 08.06.2013, 20:05

cmatrix,
Pinging the DB server before every data access is very inconvenient. I think an OnLostConnection event would be very useful.


Yes i know Pinging allways is inconvenient. I was thinking about an Improvement with a TThread which can do the job..

In my experience setting the timeout in .Properties has never worked (in MySQL anyway). I'll try looking into that further.


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...


Any proposals for such an event?
King regards, Michael

You want to help? viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image


Return to “ZeosLib 7.1 stable Forum”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest