>Depending on how you log into the system, the
>user will connect to different databases. When they do this, I store the
>Database Handle from DBI/DBD as $main::dbh. This variable has the scope of
>"the length of processing the request" and then should become undef. Easy
>under normal CGI, because you start with a whole new memory space. If I make
>this a variable in db_ora.pm, it then is persistant "forever"--or until I
>restart apache. If I make it a local in foo.pl, it has the right lifespan,
>but I can't figure out how to address is down in db_ora.pm--particularly
>with it's not just "foo.pl" but 50 different top-level scripts.
>
>Can someone help? Pointer to documentation? Am I staring at something so
>obvious that it would bite me?

Walt,

I was not able to keep persistent connections without leaking memory 
until I switched to Apache::DBI.  It did mean that I had to limit the 
number of processes to within the RAM available and make sure 
keep-alives were off, but this was fine.

Tim

Reply via email to