From: Peter Rabbitson Date: Thu, 13 Aug 2009 05:41:43 +0000 (+0000) Subject: Add a db/txn_do retry debugger (interesting results) X-Git-Tag: v0.08109~11 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7ffb42e7b7638da131aa4ca823df9a0040a94185;p=dbsrgits%2FDBIx-Class.git Add a db/txn_do retry debugger (interesting results) --- diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 42867ba..4f280ee 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -563,6 +563,8 @@ sub dbh_do { # We were not connected - reconnect and retry, but let any # exception fall right through this time + carp "Retrying $code after catching disconnected exception: $exception" + if $ENV{DBIC_DBIRETRY_DEBUG}; $self->_populate_dbh; $self->$code($self->_dbh, @_); } @@ -625,6 +627,8 @@ sub txn_do { # We were not connected, and was first try - reconnect and retry # via the while loop + carp "Retrying $coderef after catching disconnected exception: $exception" + if $ENV{DBIC_DBIRETRY_DEBUG}; $self->_populate_dbh; } }