You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Tim Bunce <Ti...@pobox.com> on 2002/08/19 14:18:50 UTC
Re: DBI->connect_cached not playing with Apache::DBI
On Fri, Aug 16, 2002 at 04:07:52PM -0700, Michael G Schwern wrote:
> On Tue, Aug 13, 2002 at 10:22:35PM +0100, Tim Bunce wrote:
> > > > But how about a new method:
> > > >
> > > > DBI->connect_method("connect");
> > > > DBI->connect_method("Apache::DBI::connect"); # effectively what "use Apache::DBI;" does now
> > > > DBI->connect_method("connect_cached");
> > >
> > > Useful, but doesn't solve the problem.
> >
> > Actually it would. I wasn't very clear. The application would do
> >
> > DBI->connect_method("connect_cached");
> > and
> > $dbh = DBI->connect(...);
>
> I'm confused. How, or maybe it's better to ask why, would this be different
> than just:
>
> $dbh = DBI->connect_cached(...);
>
> Why would useing connect_method() make it automagical but connect_cached()
> not?
Good question. I'm kind'a making this up as I go along and I can't
now remember where I thought the point of leverage/indirection was.
I'm coming round to the view that Apache::DBI should simply override
the behaviour of DBI->connect_cached in addition to DBI->connect...
Which is where you came in :)
Patches welcome.
[I've finally fixed the CC line to have the correct address for
modperl@apache.org and would appreciate comments from anyone who
can think of a good reason not to have Apache::DBI override
connect_cached in addition to connect.]
Tim.