Calling ping()

Bill Moseley <[email protected]>
Newsgroups gmane.comp.db.postgresql.dbdpg
Message-ID <[email protected]>
Ima::DBI and DBIx::Class::Storage::DBI both call ping() to check if
the database is alive before retuning a cached $dbh.

I'm curious if this is a smart approach for a very database-heavy
site, or if this might be a hold-over from the "morning after" problem
where site that were quiet all night would fail in the morning as
their connections had timed out.

Is there an advantage of calling checking $dbh->FETCH( 'Active' ) &&
$dbh->ping vs. just flagging that the dbh is dead on error and then
reconnecting next time a $dbh is needed?

Am I missing something obvious?





-- 
Bill Moseley
[email protected]
Sent from my iMutt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.