I am using PDO to connect to a Postgresql DB, using PDO::ATTR_PERSISTENT attribute which does speed up the application noticeably.
However I encountered a problem, after debugging it, found that the connections to DB die about 2 hours 11 minutes after the last SQL query executed! The fault is at the Firewall between the servers, but the networking guy refuses to have the limit higher than 24 hours (saying it would slow down the firewall) while I need it to be disabled.
I cant refresh the pooled connections by simple usage, because I cant control or ensure that ALL the pooled connections are served on a rotating base, ensuring no connection would die (causing hard to debug issues later when there is load on the server, and some connections are dead, while others are alive).
So, does anyone have any suggestion on the problem? how to keep the pooled connections alive, other than forcing the Networking guy to disable this silly timeout rule for those 2 specific servers?
Thanks!