odbc_connect - urgent

odbc_connect - urgent

am 10.01.2008 19:46:41 von Gustavo Ramalho

Hi, im in serious problems.
First sorry for bad english.

Im try to connect with many servers to take some information, but when one
of those is offline my script in php is fails and not proced.
Did have any way to configure te odbc_connect timeout?? its take to many
time to resolve take site is off or online. Im try to ping the server but
sometimes the server of internet is not same the sql server.
tks.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: odbc_connect - urgent

am 10.01.2008 22:08:42 von iODBC Maintainer

HI Gustavo,


> Hi, im in serious problems.
> First sorry for bad english.
>
> Im try to connect with many servers to take some information, but when
> one of those is offline my script in php is fails and not proced.
> Did have any way to configure te odbc_connect timeout?? its take to many
> time to resolve take site is off or online. Im try to ping the server
> but sometimes the server of internet is not same the sql server.


Unfortunately you cannot set the login timeout using the odbc_setoption
like:

odbc_setoption ($conn, 1, 103 /*SQL_LOGIN_TIMEOUT*/, 30)

since the current php odbc layer cannot handle setting connection
parameters before making an actual connection.

However most ODBC drivers do have some capabilities to adjust timeouts.
Which driver are you using to connect to sql server?


Patrick

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: odbc_connect - urgent

am 11.01.2008 03:48:40 von Gary Wardell

Hi,

You didn't mention which OS this is on.

If it's Windows, there is another factor. The timeout in ODBC and OLEDB refer to the time the server on the other end takes to
complete the operation. This is independent of the timeout set at the socket layer. So, you could set the ODBC timeout to 10
seconds, but that doesn't change the socket timeout. It will still wait for the 30 or 60 seconds, or whatever it is, before
abandoning the socket.

This is a Windows thing and has to do with the way they implemented sockets.

Gary

> -----Original Message-----
> From: iODBC Maintainer [mailto:iodbc@openlinksw.com]
> Sent: Thu, January 10, 2008 4:09 PM
> To: Gustavo Ramalho
> Cc: php-db@lists.php.net
> Subject: Re: [PHP-DB] odbc_connect - urgent
>
>
> HI Gustavo,
>
>
> > Hi, im in serious problems.
> > First sorry for bad english.
> >
> > Im try to connect with many servers to take some
> information, but when
> > one of those is offline my script in php is fails and not proced.
> > Did have any way to configure te odbc_connect timeout?? its
> take to many
> > time to resolve take site is off or online. Im try to ping
> the server
> > but sometimes the server of internet is not same the sql server.
>
>
> Unfortunately you cannot set the login timeout using the
> odbc_setoption
> like:
>
> odbc_setoption ($conn, 1, 103 /*SQL_LOGIN_TIMEOUT*/, 30)
>
> since the current php odbc layer cannot handle setting connection
> parameters before making an actual connection.
>
> However most ODBC drivers do have some capabilities to adjust
> timeouts.
> Which driver are you using to connect to sql server?
>
>
> Patrick
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php