Re: preloading modules and apache::dbi
Perrin Harkins <[email protected]>
| Newsgroups | gmane.comp.apache.mod-perl |
|---|---|
| Message-ID | <CAC0_be2uXkyYWET-NNUuJfiVpNLM9sL-0ZpUpiC3keU+FgB5AQ@mail.gmail.com> |
On Wed, Jan 18, 2012 at 5:08 PM, mike cardeiro <[email protected]> wrote: > I have a library I want to preload. This library makes a database > connection and assigns it to a variable that is exported so all programs can > use this handle. > > will this global handle db handle be a single handle amongst all apache > processes, or will each process load this library on its own thus having a > unique db handle for each httpd process? Apache::DBI does not make handles persistent when you open them during startup. However, if you are trying to make the handle persistent yourself, by putting it in a global variable or something similar, that will be a problem. You have to close all connections you open during startup, and open new ones in the child processes. - Perrin