2 messages in com.mysql.lists.perlRe: mysql server has gone away| From | Sent On | Attachments |
|---|---|---|
| mayuran | 17 Apr 2004 14:27 | |
| Greg Meckes | 18 Apr 2004 08:43 |
| Subject: | Re: mysql server has gone away![]() |
|---|---|
| From: | Greg Meckes (greg...@yahoo.com) |
| Date: | 04/18/2004 08:43:03 AM |
| List: | com.mysql.lists.perl |
Perhaps it's logic error in your code.
Can we see the rest?
Maybe this can help: http://dev.mysql.com/doc/mysql/en/Gone_away.html
--- mayuran <mayu...@casalemedia.com> wrote:
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=greg...@yahoo.com
__________________________________ Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25¢ http://photos.yahoo.com/ph/print_splash




