[Dbix-class] DBIx::Class and mod_perl

Mark Hedges hedges at ucsd.edu
Wed Mar 22 19:51:11 CET 2006


> > Date: Wed, 22 Mar 2006 11:08:59 -0600
> > From: "Brandon Black" <blblack at gmail.com>
> > Subject: Re: [Dbix-class] DBIx::Class and mod_perl
> > To: dbix-class at lists.rawmode.org
> > 
> > On 3/22/06, Rolf Schaufelberger <rs at plusw.de> wrote:
> > 
> > > What is the preferred way to have DBIx::Class to run with mod_perl ?
> > > With CDBI I use the solution described here:
> > > http://wiki.class-dbi.com/wiki/Using_with_mod_perl
> > >
> > 
> > Generally speaking, you use DBIx::Class under mod_perl just like you
> > would use it when you're not under mod_perl.  It should handle
> > everything fine without any special treatment.
> 
> Wouldn't you want to use the schema lib first from startup.pl? 
> The I would assume the information gathered from the series of 
> "describe tables" statements and relationship setups would 
> stored in the schema class package and be cloned to each 
> intepreter in each child process spawned by Apache, and then 
> each child would not have to do that upon every spawn -- it's a 
> comparatively slow step that could be avoided.

I tested this out with 500 children in Apache's config with 
MaxRequests 1 so they die and respawn.  In the virtual host 
config file I say "PerlModule My::Schema".  The "show 
tables/describe..." sequence runs twice on start-up (and twice 
on shut-down, weird), but thereafter you can always say 
My::Schema->resultset(...) and it does not re-analyze the DB.

Mark



More information about the Dbix-class mailing list