On Thu, Nov 13, 2014 at 5:29 PM, Vincent Veyron <vv.li...@wanadoo.fr> wrote:

> I stash a reference to a DBI handle in pnotes during the HeaderParser
> phase of my requests; I then refer to this handle for every request in my
> PerlResponseHandlers.
>
> This seems to have been working fine for several months. Am I doing
> something wrong?
>

No, that's perfect. Since pnotes gets cleaned up at the end of every
request, there's no danger of the handle sticking around. I assume you're
calling DBI->connect() to get the handle in the HeaderParser phase, and
using Apache::DBI?

The dangerous thing is to put a DBI handle in a global and just keep using
it on every request. If you put a DBI handle in a global (or a closure
variable) make sure you clean it up at the end of every request.

- Perrin

Reply via email to