I'm using Apache::DBI connecting to a Postgres db. I'm using Template Toolkit but no explicit db calls from within the templates -- they're all done within the perl modules.
Unfortunately after a couple of hours of moderate use Postgres reaches its max_clients level (which is set below max httpds in httpd.conf) and apache has to be graceful'd to restore the situation. At this point there's no work being done, so presumably the handles aren't being freed. I've made sure that all db calls are fully read, e.g. doing while ($sth->fetch) {..} routines on all selects so as to avoid leaving results unread. Does anyone have any tips on how to, at this point, go about detecting where the handle leak might be (which I'm presuming is the problem)? Or should Template::Toolkit be avoided altogether when using mod_perl and database connectivity? I'm using a 1.3 setup. Cheers