I think the new signal handling in perl 5.8 causes problems here.
The signal is recorded by the *C* signal handler when it happens
but calling the specified *perl* handler is deferred until it's
"safe" to do so - generally the next perl statement boundary.
If the application is stuck in some OS c
>
> David Turner <[EMAIL PROTECTED]>
> Sent by: [EMAIL PROTECTED]
> 01/14/2003 10:46 AM
> Please respond to ORACLE-L
>
>
> To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
> cc:
> Subject:Re: perl timeout
To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
> cc:
> Subject:Re: perl timeout
>
>
> Thx I left your book in Missouri:( Now I'm trying to simulate a database
> with
> hanging connections to test the script. Anyone know how bes
ROTECTED]>
Sent by: [EMAIL PROTECTED]
01/14/2003 10:46 AM
Please respond to ORACLE-L
To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
cc:
Subject: Re: perl timeout
Thx I left your book in Missouri:( Now I'm trying to simulate a
Thx I left your book in Missouri:( Now I'm trying to simulate a database with
hanging connections to test the script. Anyone know how best to simulate that?
Dave
On Mon, Jan 13, 2003 at 07:43:29PM -0800, Jared Still wrote:
>
> Gee Dave, I know of a book that has scripts that
> already do this.
Gee Dave, I know of a book that has scripts that
already do this. ;)
Here's an untested bit of code to demonstrate.
my $dbh;
eval {
local $SIG{ALRM} = sub {
die "connection timeout\n";
};
alarm 60;
$dbh = DBI->connect(
'dbi:Oracle:' . $db,
$user
Does anyone have some perl code that will return an error if it take longer
than a certain number of seconds to connect to or return the results from a
database? I'd like to have some of my queries connect to an alternate database
if there is a problem connecting or returning results within 10 seco