LazyReconnectionHandler

From ClassDBI

The idea would be to "overload" the DBI handler so that it executes a test or set reconnection each time a database operation is made as described in this article.


Maybe it could be configured this way

 Music::DBI->connection('dbi:mysql:dbname', 'username', 'password', 
       { lazy => {
          max_try => 3, 
          delay => 3, 
          mesg => "reconnection failed" , 
          critical => 1 }
        }
 );
  • max_try could be the max number of connection ;
  • delay could be in seconds before each retry
  • mesg could be the message croaked by $DBI::errstr so that it can be catched (really useful ?)
  • critical could mean no signals could be raised during this events (really usefull ?)

a non null hastable given has lazy would enable it ^^