Re: CDBI and mod_perl

[prev] [thread] [next] [Date index for 2005/02/20]

From: Perrin Harkins
Subject: Re: CDBI and mod_perl
Date: 21:31 on 20 Feb 2005
Tony Bowden wrote:
> Wouldn't I then have to provide every method that anyone might call on
> $dbh, or $sth (for every database)? Yes, I could do that with AUTOLOAD,
> but lots of what people do with $dbh and $sth aren't traditional method
> calls either (such as fetching/setting dbh->{AttributeNames}.

I was thinking you would proxy the other stuff with AUTOLOAD.  It 
doesn't matter what other people do with the $dbh, as long as everything 
Class::DBI wants to do with it works on this proxy version of 
ContextualFetch.  Other people can just use the $dbh directly.

> But even if we /could/ do all this, I'm still missing what it would buy
> us (which is what I was really asking for examples of)

What you get is the ability to use Class::DBI with database handles that 
were not originally created for Class::DBI use.  For example, I am 
trying to do some work with Class::DBI in extensions to the Krang CMS. 
Krang has its own mechanism for getting a database handle, which 
includes application-specific logic about picking the right connection 
to use.  I'd like to be able to override db_Main() and have it call the 
Krang database access routine and just use the $dbh it gets back, but I 
can't because that handle is not subclassed into the 
DBIx::ContextualFetch class.  If I re-bless it, I may break things in 
the rest of the Krang application when it gets unexpected results from 
using the $dbh.

This problem would be the same with integrating Class::DBI into any 
existing system that manages the opening of database handles, or any 
situation where Class::DBI needs to share handles with non-Class::DBI 
code that expects standard behavior from DBI.

I am glossing over the issue of the other $dbh attributes here, and I 
don't know if the sort of proxy scheme I'm suggesting is the best fix, 
but I do see this as a significant barrier to adoption of Class::DBI for 
people who have existing codebases.

- Perrin

(message missing)

Column Names
Justin Tocci 05:19 on 10 Feb 2005

Re: Column Names
Peter Speltz 20:36 on 10 Feb 2005

Re: Column Names
Rod McChesney 20:56 on 10 Feb 2005

CDBI and mod_perl
Rod McChesney 20:58 on 10 Feb 2005

Re: CDBI and mod_perl
Perrin Harkins 21:37 on 10 Feb 2005

Re: CDBI and mod_perl
Drew Wilson 21:54 on 10 Feb 2005

Re: CDBI and mod_perl
karjala_lists 13:59 on 15 Feb 2005

Re: CDBI and mod_perl
Perrin Harkins 22:16 on 10 Feb 2005

Re: CDBI and mod_perl
Drew Wilson 22:27 on 10 Feb 2005

Re: CDBI and mod_perl
Perrin Harkins 22:46 on 10 Feb 2005

Re: CDBI and mod_perl
Edward J. Sabol 23:42 on 10 Feb 2005

Re: CDBI and mod_perl
Rod McChesney 01:55 on 12 Feb 2005

Re: CDBI and mod_perl
Edward J. Sabol 19:43 on 12 Feb 2005

Re: CDBI and mod_perl
Rod McChesney 18:48 on 14 Feb 2005

Re: CDBI and mod_perl
Perrin Harkins 21:23 on 14 Feb 2005

Re: CDBI and mod_perl
Edward J. Sabol 06:53 on 14 Feb 2005

Re: CDBI and mod_perl
Perrin Harkins 21:14 on 14 Feb 2005

Re: CDBI and mod_perl
Perrin Harkins 19:59 on 15 Feb 2005

Re: CDBI and mod_perl
Tim Bunce 22:33 on 15 Feb 2005

Re: CDBI and mod_perl
Tony Bowden 22:12 on 18 Feb 2005

Re: CDBI and mod_perl
=?ISO-8859-1?Q?Ask_Bj=F8rn_Hansen?= 22:19 on 18 Feb 2005

Re: CDBI and mod_perl
Perrin Harkins 22:36 on 18 Feb 2005

Re: CDBI and mod_perl
Tony Bowden 11:23 on 19 Feb 2005

Re: CDBI and mod_perl
Perrin Harkins 13:56 on 19 Feb 2005

Re: CDBI and mod_perl
Tony Bowden 15:57 on 19 Feb 2005

Re: CDBI and mod_perl
Perrin Harkins 16:21 on 19 Feb 2005

Re: CDBI and mod_perl
Perrin Harkins 16:24 on 19 Feb 2005

Re: CDBI and mod_perl
Tony Bowden 09:54 on 20 Feb 2005

Re: CDBI and mod_perl
Perrin Harkins 21:31 on 20 Feb 2005

Re: CDBI and mod_perl
Tony Bowden 22:19 on 20 Feb 2005

Generated at 12:48 on 22 Feb 2005 by mariachi v0.52