mysql server has gone away

mysql server has gone away

am 17.04.2004 23:27:46 von Mayuran

i have a method called reconnectDB, which
loops until a connection is established to
the db, sleeping a few seconds each time.
once a connection is established is leaves
the method.

ive setup HandleError to go to a method dbErrorHandler
which looks like this:

sub dbErrorHandler {
my $error = shift;

if ( $error =~ /Lost connection to MySQL server during query/i ) {
reconnectDB();
}
}

one of the tester's tested the script by disconnecting the network
cable from the mysql machine during a query and the script died.
it goes into the dbErrorHandler sub but for some reason its not going
into the reconnectDB() sub, instead it is dying saying :
DBD::mysql::st execute failed: Lost connection to MySQL server during
query.

i was expecting it to go into reconnectDB and sleep until the connection
returns at which point it should return to dbErrorHandler, then return
to wherever it left off and resume the query. Can anyone explain why the
script is dying and how I can fix it.

Thank you


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org