Hi,
I have two fixup handlers, which I want to use in two separate
directories (dir 2 being under dir 1) :
Proxy *
...
PerlFixupHandler Apache2::mod_AAA
...
/Proxy
...
...
Proxy https://server/BBB/
...
PerlFixupHandler Apache2::mod_BBB
...
/Proxy
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
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
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), or
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(); ...
}
No,
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
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'.
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
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 in
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
Author: pgollucci
Date: Fri Jun 23 22:46:05 2006
New Revision: 416863
URL: http://svn.apache.org/viewvc?rev=416863view=rev
Log:
add svn repo layout structure
Added:
perl/Apache-SizeLimit/branches/
perl/Apache-SizeLimit/tags/
perl/Apache-SizeLimit/trunk/
Author: pgollucci
Date: Fri Jun 23 22:56:18 2006
New Revision: 416864
URL: http://svn.apache.org/viewvc?rev=416864view=rev
Log:
add a skeleton from:
h2xs -XA -n Apache::SizeLimit
mv Apache-SizeLimit/* trunk
svn add *
svn ci
soon to be overwritten in almost its
12 matches
Mail list logo