Re: mysql_connect_timeout problem when using times less than 1 sec
- From: duncan.wren@xxxxxxxxx (Duncan Wren)
- Date: Sun, 24 Sep 2006 11:23:53 +0100
I have looked at the code for DBD::mysql and DBI.pm but cannot workout where
the timeout is implemented or where the default is specified. Does anyone
know where this logic is implemented? I would rather make make the change in
the module that currently implements the time out code than add some logic
to add timeout in my application code.
Duncan
On 24/09/06, Alexander Foken <alexander@xxxxxxxx> wrote:
Without looking at the source code of DBD::mysql, I would quess that the
mysql_connect_timeout parameter is an integer. 0.5 is rounded down to 0,
which is the same as not specifying mysql_connect_timeout at all. If you
are on a Unix/POSIX System, alarm() and Signals may help.
Alexander
On 23.09.2006 18:02, Duncan Wren wrote:
> The DBI module when connecting to a mysql database seams to only support
> integer values for the mysql_connect_timeout if you use say 0.5 secs
> as the
> timeout value it defaults to 3secs. Does anyone know a way round this
> problem as i need a very short timeout in my application.
>
> for example
>
> #does not work and defaults to 3 secs timeout
> $dbh =
> DBI->connect("DBI:mysql:db_name:db_host:3306;mysql_connect_timeout=
> 0.5","username","password");
>
> #does work and timesout after 1 sec
> $dbh =
>
DBI->connect("DBI:mysql:db_name:db_host:3306;mysql_connect_timeout=1","username","password");
>
>
> Thanks
>
> Duncan
>
--
Alexander Foken
mailto:alexander@xxxxxxxx http://www.foken.de/alexander/
- Follow-Ups:
- Re: mysql_connect_timeout problem when using times less than 1 sec
- From: Alexander Foken
- Re: mysql_connect_timeout problem when using times less than 1 sec
- References:
- mysql_connect_timeout problem when using times less than 1 sec
- From: Duncan Wren
- Re: mysql_connect_timeout problem when using times less than 1 sec
- From: Alexander Foken
- mysql_connect_timeout problem when using times less than 1 sec
- Prev by Date: Re: mysql_connect_timeout problem when using times less than 1 sec
- Next by Date: Re: mysql_connect_timeout problem when using times less than 1 sec
- Previous by thread: Re: mysql_connect_timeout problem when using times less than 1 sec
- Next by thread: Re: mysql_connect_timeout problem when using times less than 1 sec
- Index(es):
Relevant Pages
|
|