On Oct 3, 2009, at 5:25 AM, Perrin Harkins wrote:
It's safe to create a connection on
startup with DBIx::Connection though, as it is careful not to cache
across
fork or thread boundaries.
It may be necessary to set InactiveDestroy on any handles you open
during startup, even if you avoid ever using them again. They will
eventually time out and may cause trouble when the database tries to
clean them up.
I realized, reading this, that I should check for the Apache startup
and not cache things if it's during startup. That's useful under
mod_perl, and won't hurt anything elsewhere. I'll get that committed
this weekend.
But yes, when DBIx::Connection detects that it's in a new process and
expires the cached handle, it first sets InactiveDestroy to true. So
we should be good there.
Best,
David