On Thu, 2006-06-22 at 11:20 -0700, Jay Buffington wrote:
I'm considering writing a PerlLogHandler that will print out the
memory usage (using GTop) before and after each request so I can find
the offending code path.
I wrote this script and it turned out to work very well. It's small,
so I inc
So I want to register a method to be run during the cleanup phase. After the content phase I'm in the logging phase and I do the following:$r->register_cleanup(sub { $self->process_queue(); }); Inside process_queue method I print out what phase I'm in using r->current_callback(), it "claims" I'm i
Perrin Harkins wrote:
Create a new instance of the mod_perl handler module during startup
and refer to that for the handlers (code below).
This module would then cache DB connections and provide a method for
'create or fetch current DB connection'.
DBI->connect_cached will do all of this f
Zitat von Perrin Harkins <[EMAIL PROTECTED]>:
> > Create a new instance of the mod_perl handler module during startup and
> > refer to that for the handlers (code below).
> > This module would then cache DB connections and provide a method for
> > 'create or fetch current DB connection'.
>
> DBI->
John ORourke wrote:
It does make a separate DB connection in each apache process but
I think trying to share 1 DB connection between httpd's is probably
going to cost more than it gains.
It's not actually possible to share a connection between processes
unless your database library explicitly
Personally I don't use Apaceh::DBI, because I have a similar situation
to you. Here's how I do it, it may not be the best way but it's fairly
clean. It does make a separate DB connection in each apache process but
I think trying to share 1 DB connection between httpd's is probably
going to co
Tobias Kremer wrote:
Ok, got that! But how does the class get its database handle to operate on?
One of these ways:
my $dbh = DBI->connect_cached(...);
my $dbh = My::Database->get_dbh();
You do that every time you need one.
sub new {
... $self->{_dbh} = My::Database->new()->dbh(); ...
}
Zitat von Perrin Harkins <[EMAIL PROTECTED]>:
> You need to separate managing your database connections from caching
> this data. They are not related, and there's no reason to do both in
> one class. Either just call connect_cached all the time (it uses
> Apache::DBI when it finds it loaded), o
Tobias Kremer wrote:
That's easy under standalone conditions (connect within new,
store the dbh in $self->{_dbh} and use that in other methods).
I don't recommend doing that. Better to use DBI->connect_cached in most
cases. It will actually check to see if your connection is still good
befo
Hey guys,
I'm wondering what's the best way to design a database-backed module
which works completely on its own as well as within mod_perl (mp1).
The module should make a database connection during object initialization
(new). This connection should then be used by all methods which want to
acces
Hi,
I have two fixup handlers, which I want to use in two separate
directories (dir 2 being under dir 1) :
...
PerlFixupHandler Apache2::mod_AAA
...
...
...
https://server/BBB/>
...
PerlFixupHandler Apache2::mod_BBB
...
Is this allowed ? Will it
11 matches
Mail list logo