[prev in list] [next in list] [prev in thread] [next in thread]
List: mason
Subject: Re: [Mason] handler.pl
From: z thompson <cublai () lastamericanempire ! com>
Date: 2001-08-28 17:28:16
[Download RAW message or body]
* Dave Rolsky <autarch@urth.org> [010824 22:08]:
> On Fri, 24 Aug 2001, Scott Lanning wrote:
>
> Not really. If you simply want to use Apache::DBI you could do this:
>
>
> httpd.conf
> -------------
> PerlModule Apache::DBI
> PerlModule DBI
> # order is important, DBI must come second
>
>
> top level autohandler that all components inherit from
> ---------------
> $HTML::Mason::Commands::dbh ||= DBI->connect(...);
>
>
> If you want to take advantage of Apache::DBI's ability to create a new
> database handler immediately after an Apache process is forked (rather
> than when it is requested) you could this in your httpd.conf:
>
> <Perl>
> Apache::DBI->connect_on_init(...); # same params as to DBI->connect()
> </Perl>
>
Even after all of this I am still confused as to how you get a global
$dbh in a component without actually connecting in the component. Are
$HTML::Mason::Commands::dbh and connect_on_init used in conjunction
or do they exclude one another?
Is there another way to get a $dbh per process without using an
autohandler or is this the standard method? If only the connect_on_init
is specified in httpd.conf, how do you get a reference to a db handle
other than the traditional my $dbh = DBI->connect(..) in the component?
Cheers,
Zach Thompson
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mason-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic