Hi there,

in the early days of the dbi-modul there was a function $dbh->ping().
nearly no driver ever implemented it. 

I want to check the status of my db, in my daemon on a regular base.
I could not find any standard solution. Today I´m just doing a query 
and check then if there where errors.


Also I want to reread the DB config.
(My Daemons are running stable for years, but the DB-Guy switch from one db to 
another
on a weekly base and I just wont care if my configfile is reread.)


I do it this way :(RaiseErrors is off)

my $sth = $dbh->prepare("$query");  

$sth->execute();                

# $sth->finish(); #not needed with autocommit

if ( defined $DBI::errstr || defined $sth->errstr()){
# close db. 
#... reread configurationfile and
# connect with new config.
}

Reply via email to