In the section on optimizing the db and prepare statements (in the
http://perl.apache.org/guide/performance.html url), the document discusses
creating a subroutine called "connect" in a package called package My::DB;
My question is if you have the

my $dbh = My::DB->connect;

statement in another package, what exactly happens to that connection
between request of the script using that package?  For instance, let's say
that statement was contained in package foo.pm and is used in the script
bar.cgi.  If this script is being loaded in mod_perl, when is this
connection being re-established?

Let me see if I can explain the situation that I'm dealing with.  In my
case, let's say I have the script bar.cgi being executed.   I put some
warnings in that connect subroutine that tell me when it's being called.
I look at the error_log in Apache to see when this connection is being
called.  Let's say out of 5-6 times, the function isn't called (which
presumably is because the connection is either persistent or that the
module being loaded in mod_perl doesn't go away??) but on the 7th or so
time I see it called.  The error seems inconsistent.  My guess was that
the connection is maintained as a process until it goes away, but I'm not
100% certain.

The situation kinda sucks because the connection gets lost or is killed by
a trigger in Oracle (after 60 minutes), but I have no real way of figuring
out when this situation arises.  So going back to my question, when is the
connection getting reestablished using this code?

Anyway, while I'm on the topic of disconnecting DBs, I've been getting
this error in the logs:

Rebuild with -DPERL_STACKED_HANDLERS to $r->push_handlers at
/usr/lib/perl5/site_perl/5.005/Apache/DBI.pm line 93.

What is this error?  How can I specifically deal with it?  And lastly is
this issue connected with my connection not getting reconnected
occasionally?  Thanks
(Really tired.  Sorry)


--------------------------------------------------------------------------

Why is College Club the largest and fastest growing college student site?
Find out for yourself at http://www.collegeclub.com


Reply via email to