> > > At some point during initialization (no loading yet far as I can tell)
> > > I receive an error message like...
>
> > > Cannot create method ACME::DB::SomeTable::some_column_name - method
> > > already exists at /opt/acme-perl/perl-5.12.2/lib/site_perl/5.12.2/Rose/
> > > DB/Object/Metadata/MethodMaker.pm line 426
>
> > That looks like a class being set up more than once. Circular module
> > dependencies maybe? I'm not sure why the column_type_classes map
> > would affect that. I suggest trying to boil it down to a minimal test
> > case.
I was able to isolate the problem and confirm that there were no
circular dependencies. The foreign key relationship appears to be the
key to the bug. I am not sure what to do about it though.
#
# For table foo
#
package ACME::DB::Foo;
...
__PACKAGE__->meta->setup
(
columns => [ code => { type => 'character' } ],
primary_key_columns => ['code']
);
...
#
# for table bar
#
package ACME::DB::Bar;
...
__PACKAGE__->meta->setup
(
columns => [ baz_qux_code => { type => 'character' } ],
foreign_keys =>
[
baz_qux_code =>
{
class => 'ACME::DB::Foo',
key_columns { baz_qux_code => 'code' }
}
]
);
...
);