- Timestamp:
- 02/04/05 11:04:55 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/cgi-bin/CustIDCK.pm
r114 r151 38 38 local $SIG{ALRM} = sub { die "failed connection to billing!!" }; 39 39 alarm 3; # 3-second timeout. This may be too aggressive. 40 $dbh = DBI->connect ("DBI:Pg:host=billing;dbname=custids", "cidcheck", "c1dch4ck"); 40 41 eval { 42 $dbh = DBI->connect ("DBI:Pg:host=billing;dbname=custids", "cidcheck", "c1dch4ck"); 43 die "failed connection to billing!!" if !$dbh; 44 # Not certain if this is needed here. It doesn't seem to be. 45 # $dbh->ping; # Gotta do this to "force" a "failure". NRGH. 46 }; 41 47 alarm 0; # cancel the alarm 48 $dbh->ping; # Gotta do this to "force" a "failure". NRGH. 42 49 }; 43 50 alarm 0; # avoid race conditions. May not be needed here. (Hah!) … … 48 55 } 49 56 50 my $sth = $dbh->prepare("SELECT custid FROM custid WHERE custid = '$custid';"); 57 # We should have a valid DB connection by now. 58 my $sth = $dbh->prepare("SELECT custid FROM custid WHERE custid = '$custid'"); 51 59 $sth->execute; 52 60 if ($dbh->err) {
Note:
See TracChangeset
for help on using the changeset viewer.