[Omaha.pm] Pulling data from a crappy MS-SQL server somewhere in Mexico...

Jay Hannah jay at jays.net
Thu Mar 6 13:16:48 PST 2008


It's nice to know that with enough retries and error handling, you can, 
eventually pull data from a bad server over a terrible network 
connection...  :)

Perl in Omaha <-> DBI <-> DBD::Sybase <-> freetds <-> MS-SQL in Mexico

:)

j



   my $sth = $dbh_pms->prepare($strsql);
   for (1..50) {
      if ($sth->execute) {
         last;
      } else {
         $logger->warn("Database error detected (attempt # $_). Waiting 
3 seconds, then retrying: $DBI::errstr");
         $sth->finish;
         $sth = $dbh_pms->prepare($strsql);
         sleep 3;
      }
   }





More information about the Omaha-pm mailing list