3 messages in com.mysql.lists.perlRe: reconnect
FromSent OnAttachments
Thomas Jalsovsky20 Aug 2002 01:24 
Uli B20 Aug 2002 02:32 
Jochen Wiedmann20 Aug 2002 05:00 
Subject:Re: reconnect
From:Jochen Wiedmann (jo@ispsoft.de)
Date:08/20/2002 05:00:02 AM
List:com.mysql.lists.perl

Zitiere Thomas Jalsovsky <adm@postel.sk>:

Do I need to reconnect if my database goes away and goes back? 1. db shutdown 2. some sql queries which fail (error handling) 3. db back 4. ?reconnect? 4?5. sql queries

The driver has a certain degree of ability to reconnect. However, that only works in the absence of transactions, which you are most probably going to use.

I would suggest to encapsulate the database handling. If something goes wrong, assume the database connection to be dead. Close it and reconnect.