MySQL Forums
Forum List  »  Perl

Re: handling mysql errors
Posted by: Bill Karwin
Date: July 31, 2006 12:34PM

It's in an infinite loop here:

while( !$dbh ) {
  if( $dbh = DBI->connect(...) ) {
    ... return( $dbh );
  } else {
    warn( $DBI::errstr );
    sleep(2);
  }
}

If connect fails, your else block runs, and then loops to try again. Does this ever break out? Do you want to keep count of retries and return an error if ++$retries exceeds a certain maximum?

If the connection succeeds with a FQDN but not with a simple hostname, I would assume your router is configured fine, but your client host is not resolving the simple hostname.

Options: ReplyQuote


Subject
Written By
Posted
July 27, 2006 07:50PM
July 27, 2006 08:20PM
Re: handling mysql errors
July 31, 2006 12:34PM
July 31, 2006 10:24PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.