Re: Utterly confused about set_db and db_Main

[prev] [thread] [next] [Date index for 2004/04/28]

From: Tony Bowden
Subject: Re: Utterly confused about set_db and db_Main
Date: 20:02 on 28 Apr 2004
On Wed, Apr 28, 2004 at 09:40:15PM +0200, Alexander Gr?fe wrote:
> I've tried removing the set_db from my base class und putting in:
> sub db_Main { Ima::DBI->connect_cached(@conn_info); }

That's the old way ... there's a more modern thread in the last few
weeks about how to do it now that Ima::DBI has been broken in two.
See messages around: 
  http://groups.kasei.com/mail/arc/cdbi-talk/2004-04/msg00050.html

You basically need to call DBI->connect_cached with the default Class::DBI
attributes (especially RootClass => "DBIx::ContextualFetch")

This is documented in the *latest* release candidate, which probably
isn't the one you have installed, as it's not actually public yet! :)

> With the latest 0.96 release candidate of CDBI, I get this compilation
> error:
> has_a needs a valid column at
> /usr/lib/perl5/site_perl/5.8.0/Class/DBI/Relationship/HasA.pm line 12

You probably have a has_many declaration getting compiled before the
has_a that mirrors it. If you're defining multiple classes in the same
file, try switching the order around.

For a much longer explanation see:
  http://groups.kasei.com/mail/arc/cdbi-talk/2004-04/msg00146.html

Or you can wait a few hours for the new release candidate in which this
has (hopefully) been fixed.

I'm having one last go at the failing Pg test, and if I don't get anywhere
with it I'm just commenting it out for now as it's testing an undocumented
feature anyway!

Tony

Utterly confused about set_db and db_Main
Alexander =?iso-8859-1?Q?Gr=E4fe?= 19:40 on 28 Apr 2004

Re: Utterly confused about set_db and db_Main
Tony Bowden 20:02 on 28 Apr 2004

Re: Utterly confused about set_db and db_Main
Alexander =?iso-8859-1?Q?Gr=E4fe?= 19:47 on 29 Apr 2004

Re: Utterly confused about set_db and db_Main
Vince Veselosky 20:08 on 28 Apr 2004

Re: Utterly confused about set_db and db_Main
Dana Hudes 20:14 on 28 Apr 2004

Re: Utterly confused about set_db and db_Main
Alexander =?iso-8859-1?Q?Gr=E4fe?= 19:55 on 29 Apr 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52