On Mon, Aug 12, 2002 at 07:56:57AM +0100, Tim Bunce wrote:
> They (slightly) have different semantics so I'd be reluctant to
> transparently substitute one for another.

Fair nuff.


> 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.

I had assumed DBI->connect_cached() was just intellegently deciding whether
to use Apache::DBI or DBI's own caching mechanism, that way DBI programmers
just didn't have to worry about whether their program was running under
mod_perl or stand-alone.  DBI would just figure out the right sort of
caching to do.

With the current situation, one has to have logic like this in their DBI
programs:

     if( we're running under mod_perl ) {
         connect using Apache::DBI
     }
     else {
         connect using DBI->connect_cached
     }

the suggestion above just makes the "connect using" part a bit easier, but
doesn't solve the problem of having to manually choose.  For myself this
isn't much of a problem, I can just put the logic into Ima::DBI.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl Quality Assurance      <[EMAIL PROTECTED]>         Kwalitee Is Job One
Death?  Its like being on holiday with a group of Germans.

Reply via email to