in reply to Preventing database handles from going stale

weird. two things come to mind:

  • You could reconnect every x seconds.
  • Maybe you could also "poll" the db in some event loop with a simple query ("select sysdate from dual;"). It is possible that you would need to fork to do that cleanly (with some synchronization between father/child). Really the DBD should give something.
  • hth --stephan
    • Comment on Re: Preventing database handles from going stale

    Replies are listed 'Best First'.
    Re^2: Preventing database handles from going stale
    by dsheroh (Monsignor) on Feb 05, 2007 at 17:38 UTC
      I had initially assumed that ping was already doing something like your second suggestion, but apparently not. I've already got a decent scheduling system in place, so setting it up do do either of those every n seconds would be relatively trivial.

      I agree that it seems odd for DBI not to have a generic method (implemented by each DBD) for dealing with this sort of thing.