$obj->delete doesn't remove from the DB

[prev] [thread] [next] [Date index for 2004/06/18]

From: Yuval Kogman
Subject: $obj->delete doesn't remove from the DB
Date: 14:48 on 18 Jun 2004
--bjuZg6miEcdLYP6q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi,

I have some code to break a many to many relationship (is there a better
way?) which currently implements remove_from_$accessor in
CDBIR::HasMany.


If $artist has many (think participated in) $albums, then I do

	$artist->add_to_repertoire($album);

and get a new row in the table ArtistHasAlbums, via mappings.

The remove_from method has

	my $link =3D $f_class->retrieve($data_f_key =3D> $data->id, $self_f_key =
=3D> $self->id);
	$link->delete;

at which point the $link object is reblessed into
CDBI::Has::Been::Deleted or whatever it's called, but the database row
for the link itself remains. If cascading delete is supposed to happen
because the link has_a artist and has_a album, that's not happenning
either.

I'm pretty sure I got it wrong, because I'm a total CDBI n00b, but I
have no idea where to begin cleaning up after myself.

Thanks in advance,

--=20
 ()  Yuval Kogman <nothingmuch@xxxxxxxx.xxx> 0xEBD27418  perl hacker &
 /\  kung foo master: /me kicks %s on the nose: neeyah!!!!!!!!!!!!!!!!!


--bjuZg6miEcdLYP6q
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFA0wCnVCwRwOvSdBgRAtcwAJ9tmOvbuI1bk2TEwE3mDKjnQmZzAQCfTlop
YZ1EcNYNMhr7Na3yCqdSa8M=
=zQgk
-----END PGP SIGNATURE-----

--bjuZg6miEcdLYP6q--

$obj->delete doesn't remove from the DB
Yuval Kogman 14:48 on 18 Jun 2004

Re: $obj->delete doesn't remove from the DB
William McKee 16:00 on 18 Jun 2004

Re: $obj->delete doesn't remove from the DB
Yuval Kogman 17:14 on 18 Jun 2004

Re: $obj->delete doesn't remove from the DB
Tony Bowden 16:41 on 18 Jun 2004

Re: $obj->delete doesn't remove from the DB
Yuval Kogman 17:19 on 18 Jun 2004

Re: $obj->delete doesn't remove from the DB
Yuval Kogman 20:59 on 19 Jun 2004

Re: $obj->delete doesn't remove from the DB
Yuval Kogman 21:18 on 19 Jun 2004

Re: $obj->delete doesn't remove from the DB
Yuval Kogman 21:32 on 19 Jun 2004

Re: $obj->delete doesn't remove from the DB
Tony Bowden 21:48 on 19 Jun 2004

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