different FIxupHandler in different subdirs of reverse-proxy

2006-06-23 Thread Charles Bueche
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

(Database-)Object initialization during server-startup

2006-06-23 Thread Tobias Kremer
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

Re: (Database-)Object initialization during server-startup

2006-06-23 Thread Perrin Harkins
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

Re: (Database-)Object initialization during server-startup

2006-06-23 Thread Tobias Kremer
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

Re: (Database-)Object initialization during server-startup

2006-06-23 Thread Perrin Harkins
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,

Re: (Database-)Object initialization during server-startup

2006-06-23 Thread Perrin Harkins
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

Re: (Database-)Object initialization during server-startup

2006-06-23 Thread Tobias Kremer
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'.

Re: (Database-)Object initialization during server-startup

2006-06-23 Thread John ORourke
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

bug in current_callback or worse?!?!

2006-06-23 Thread john doe
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

Re: Tracking down memory hogs

2006-06-23 Thread Jay Buffington
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

svn commit: r416863 - in /perl/Apache-SizeLimit: branches/ tags/ trunk/

2006-06-23 Thread pgollucci
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/

svn commit: r416864 - in /perl/Apache-SizeLimit/trunk: Changes MANIFEST Makefile.PL README lib/ lib/Apache-SizeLimit.pm t/ t/Apache-SizeLimit.t

2006-06-23 Thread pgollucci
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