Page 1 of 1

6.6.2-RC Connection Timeout

Posted: 26.08.2008, 12:52
by ChaosBiker
Is there a way to modify connection timeout?
Say be able to have connect give up after x number of seconds?

Posted: 26.08.2008, 19:43
by mdaems
Depends on your database.
For mysql it should be as easy as adding 'timeout=x' to the ZConnection.Properties

Mark

Posted: 27.08.2008, 21:03
by seawolf
Firebird at the moment does not support timeout=X but changing:

ZdbcInterbsae6.pas

Append at the end of "constructor TZInterbase6Connection.Create"

ConnectTimeout := StrToIntDef(Info.Values['timeout'], -1);
if ConnectTimeout >= 0 then
self.Info.Values['isc_dpb_connect_timeout'] := IntToStr(ConnectTimeout);

(declaring ConnectTimeout : integer; at the beginning of that function)

ZDbcInterbase6Utils.pas

case ParamNo of
0: Continue;
isc_dpb_set_db_SQL_dialect:
Dialect := StrToIntDef(ParamValue, 0);
isc_dpb_user_name, isc_dpb_password, isc_dpb_password_enc,
isc_dpb_sys_user_name, isc_dpb_license, isc_dpb_encrypt_key,
isc_dpb_lc_messages, isc_dpb_lc_ctype, isc_dpb_sql_role_name, isc_dpb_connect_timeout:

Adding "isc_dpb_connect_timeout" after ", isc_dpb_sql_role_name, "

Posted: 27.08.2008, 21:18
by ChaosBiker
"
Depends on your database.
For mysql it should be as easy as adding 'timeout=x' to the ZConnection.Properties
"

asume x is in seconds?

does the same work for MSSQL ?

Posted: 27.08.2008, 21:38
by ChaosBiker
adding
timeout=5
to properties, does NOT seem to work :(
it's still sitting waiting there for quite a while, until it finally gives up...

Posted: 27.08.2008, 22:41
by mdaems
I think you were using Mssql...

Can you set a debug point in procedure TZDBLibConnection.InternalLogin ? In that function the timeout value should be set Can you step trough to see if that's handled allright?. If you're using the ADO protocol, the timeout property isn't supported, however.

Posted: 28.08.2008, 08:27
by ChaosBiker
usign MSSQL

once I get that working mysql is next.
will have a look at the TZDBLibConnetion