Re: DBD::ODBC - default timeout is 30 seconds instead of none



Dino Kern wrote:
Hello,
I'm using DBD::ODBC Version 1.13 and had following problem:
Te connection timed out after exactly 30 seconds even when
"odbc_query_timeout" was not set.
According to the documentation there should be no timeout in this case.
After setting the timeout to a higher value it worked.

Maybe the documentation has to be rectified to:
"Default timeout is 30 second".

Best regards,
Dino



Don't confuse connection timeout and query timeout - they are not the same. Connection timeout only applies to non login and query execution ODBC APIS.

The default in DBD::ODBC is actually to not set it at all because the current DBD::ODBC code sets the default internal variable odbc_query_timeout to 0 and then does:

if (imp_dbh->odbc_query_timeout) {
ret = odbc_set_query_timeout(dbh, stmt,
imp_dbh->odbc_query_timeout);
}

in the execdirect and prepare methods which obviously does not get run if odbc_query_timeout is 0.

The ODBC spec says:

o the default is 0 which is no timeout
o the driver may implement minimum and maximum values the timeout may be set to.

so not setting the query timeout should use the default of 0 or no timeout. I believe the DBD::ODBC code is correct in this other than if you were to set it to N (where N <> 0) then set it to 0, the second set would not get executed - I will rectify this.

I suspect the ODBC driver you are using is defaulting it to 30 as DBD::ODBC is not setting the timeout by default.

I will attempt to make this clearer in the pod for the next DBD::ODBC.

Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com
.



Relevant Pages

  • Re: rs232 -help!
    ... Okay, I never really found out how to set the comm timeout, however I got it ... I can read the port and the Read functon ... rs232 port asides from using the SerialWnd class.... ... posts from everyone, and then I read over the rs232 documentation, and then I ...
    (microsoft.public.vc.language)
  • Re: telnetlib close not closing sockets
    ... Telnetlib's documentation even clearly ... I'm not reaching timeout there. ... I have to say I'm much impressed with the python language, ... > Hello Mike, ...
    (comp.lang.python)
  • Re: setting socket connect timeout
    ... I am trying to write some production code based on: ... Does anyone know how to change the timeout? ... My documentation is quite old but it did contain a statement about timeouts just ...
    (comp.os.vms)
  • Re: TCP Connection Timeout ?
    ... > It would be a registry setting. ... I'll see if I can find the documentation ... >> Hi Paul, ... >> How can I change the timeout for all connections? ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Timers & socket select
    ... See the documentation of select, you can pass it a timeout ... So you don't need any extra timers. ... but peer review on non-C questions is notoriously lacking. ...
    (comp.lang.c)