Set Firebird connection timeout lazarus / 16-Databases ---------------------------------------------------------------------- sin_dragan · 2014-01-03 08:56 I'm writing a client application that uses FireBird 2.5.2 as server, Lazarus SqlDb components. I can't set the connection timeout, the standard 15 seconds are too long. I tried to add ConnectionTimeout=5 or ConnectTimeout in params but it's still the same. For example, I used this in Postgres client and it worked: Code: [Select]object PQConn: TPQConnection     Connected = False     LoginPrompt = False     DatabaseName = 'backoffice'     KeepConnection = True     Params.Strings = (       'connect_timeout=2'     )     Transaction = PgTran     CharSet = 'UTF8'     HostName = '10.2.0.216'     LogEvents = []     Role = 'public'     left = 152     top = 48   Params.Strings = ('connect_timeout=2') Thx in advance ---------------------------------------------------------------------- BigChimp · 2014-01-04 13:07 Quote from: sin_dragan on January 03, 2014, 09:56:12 amI tried to add ConnectionTimeout=5 or ConnectTimeout in params but it's still the same. Well.. you'd have to look to see what kinds of params are supported for Firebird. The supported params are different for each database. See here for documentation: http://www.freepascal.org/docs-html/fcl/ibconnection/index.html By heart, I don't *think* you can set the timeout as a param, but perhaps the Firebird sqldb connector/underlying Firebird driver do support it (and only need a patch). ---------------------------------------------------------------------- sin_dragan · 2014-01-05 13:17 Quote from: BigChimp on January 04, 2014, 02:07:21 pmQuote from: sin_dragan on January 03, 2014, 09:56:12 amI tried to add ConnectionTimeout=5 or ConnectTimeout in params but it's still the same. Well.. you'd have to look to see what kinds of params are supported for Firebird. The supported params are different for each database. Hi, I tried from information found here: http://www.janus-software.com/fbmanual/manual.php?book=admin&topic=6 CONNECTION TIMEOUT Purpose Use the ConnectionTimeout parameter to specify the number of seconds to wait before concluding an attempt to connect has failed. Syntax ::=    ConnectionTimeout = Semantics This parameter is used by clients. It sets the number of seconds a client will wait before giving up and reporting back connection unavailability. The default value for this parameter is 180 seconds on all platforms. Example The below example increases the connection wait time from 180 to 240 seconds: ConnectionTimeout = 240 I'll keep trying and write back if I find anything. ---------------------------------------------------------------------- BigChimp · 2014-01-05 13:27 So... where is one supposed to set this string? firebird.conf? Edit: seems so: Firebird.conf (fb 2.5) has: Quote# ---------------------------- # Client Connection Settings (Basic) # # Seconds to wait before concluding an attempt to connect has failed. # # Type: integer # #ConnectionTimeout = 180 Edit2: as I indicated, the C translation layer against the FB client driver may perhaps be used as well; you can also have a look in $(fpcdir)\packages\ibase\src\ibase60.inc and search for timeout... ---------------------------------------------------------------------- sin_dragan · 2014-01-05 18:29 Thank you for your guidance, I ve searched some more. Quote from: BigChimp on January 05, 2014, 02:27:52 pmSo... where is one supposed to set this string? firebird.conf? Edit: seems so: Firebird.conf (fb 2.5) has: # ---------------------------- # Client Connection Settings (Basic) # # Seconds to wait before concluding an attempt to connect has failed. # # Type: integer # #ConnectionTimeout = 180 I'm a bit confused, to my knowledge fbclient.dll is supposed to be using firebird.conf one level up (like in directory where it's installed ) I ve changed this parameter in firebird.conf, and even put the DLL's in the same directory and firebird.conf one level up, but it has no effect. The GDSErrorCode that occurs on exception is 335544721, which is defined in ibase40.pp (isc_network_error = 335544721) I found in ibase60.inc definition of constants: isc_dpb_connect_timeout = 57; isc_spb_connect_timeout = isc_dpb_connect_timeout; but to be honest I don't know how to use these. Also, on another post I found that I should put next values in Params list: isc_dpb_connect_timeout=10 isc_dpb_dummy_packet_interval=60 I tried that but it's still the same.