An Ima::DBI user recently pointed out that DBI->connect_cached is not using
Apache::DBI like DBI->connect does and DBI->connect_cached has slightly
different semantics from Apache::DBI.
sub connect_cached {
# XXX we expect Apache::DBI users to still call connect()
my ($class, $dsn, $user, $pass, $attr) = @_;
($attr ||= {})->{dbi_connect_method} = 'connect_cached';
return $class->connect($dsn, $user, $pass, $attr);
}
There's a problem with the logic in the comment above. Apache::DBI is
supposed to be transparently used by DBI. So, in effect, there are no
Apache::DBI users. More pragmatically, I write a lot of dual-natured
programs. Stuff that might be run under Apache::Registry or might be
a stand-alone. I like using connect_cached() because I don't have to
store a global $Dbh, but I thought I was getting the performance boosts of
Apache::DBI where applicable.
So I guess the question is, why doesn't DBI->connect_cached just defer to
Apache::DBI->connect?
--
Michael G. Schwern <[EMAIL PROTECTED]> http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
Death was thought to be fatal.
-- Craig A. Berry in <a05101002b8165afc6b62@[172.16.52.1]>