in reply to Re^6: Preventing database handles from going stale
in thread Preventing database handles from going stale

I think ping is implemented as a query. I sometimes see "SELECT 'DBD::Pg ping test'" in pg_stat_activity, and I can't imagine that's anything else.

Replies are listed 'Best First'.
Re^8: Preventing database handles from going stale
by EvanK (Chaplain) on Feb 05, 2007 at 18:46 UTC
    It is, I just took a peek at the source code for it, and it does a SELECT (dbd_db_ping(dbh) in dbdimp.c). I don't know why that wouldn't be enough to keep the connection alive though...Perhaps the query needs to interact with an existing table to keep the connection alive?

    __________
    The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.
    - Terry Pratchett