dsheroh has asked for the wisdom of the Perl Monks concerning the following question:
I assume this is a timeout issue, but all searches I've done (here, google, etc.) have just turned up information on using signals to set DBI/query timeouts, not how to prevent them. I have also attempted in vain to locate any way of changing/disabling connection idle timeouts via DBI, DBD::Pg, and the Postgres configuration.DBD::Pg::db do failed: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.
I am also frequently seeing
message type 0x43 arrived from server while idle message type 0x5a arrived from server while idle
The best I've been able to achieve so far is to do a $dbh->ping || initialize_database_connection(); right before going into my main processing, which mostly works, but, race conditions being what they are, I still get the DBD::Pg::db error on occasion when $dbh goes stale between the ping and the next query. I had actually been hoping that whatever test DBD::Pg->ping does would itself be enough to keep the connection alive, but no such luck.
Any suggestions on how to keep this db connection from going bad on me?
|
|---|