[CDBI] Re: Error deleting object with has_many instances

Peter Speltz peterspeltz at gmail.com
Wed Feb 8 03:05:57 GMT 2006


On 2/7/06, Perrin Harkins <perrin at elem.com> wrote:
> On Tue, 2006-02-07 at 16:37 -0600, Peter Speltz wrote:
> > I think this maybe a perpared_cached issue or something.  I read some
> > on another post and tried :
> > $self->db_Main->{CachedKids} = {};
> > $self->db_Main->{mysql_auto_reconnect} = 0;
>
> It doesn't look like a MySQL or DBI issue -- Class::DBI just seems to be
> generating invalid SQL.  I've never seen this error, but I don't use
> your version (I run 0.96).
>
> Why don't you post the code that sets up the has_many and the classes in
> question?
>
> - Perrin
>
>

Ahh. After much printing of debugging statements and wrapping things
in eval throughout the call,  I found the cause. I'm so fired .   Its
embarassing. :)
 I had installed the  SVN version of Maypole which changed its
"delete"  method in the model class. I had forgotten that Maypole
Model CDBI has a delete method.  That pesky"delete" method was redone
and failed on  deletes made from a cascade but worked when there was
no cascade.

I always forget about those poorly named methods. I dont even know how
to call Class::DBI 's delete. :)  What would that be
$self->SUPER->SUPER::delete?  I'm cutting that method out of my copy 
Maypole::Model::CDBI.pm

Thanks Perrin.




More information about the ClassDBI mailing list