Re: Deleting an object on the other side of a has_a

[prev] [thread] [next] [Date index for 2004/09/02]

From: William McKee
Subject: Re: Deleting an object on the other side of a has_a
Date: 14:57 on 02 Sep 2004
On Thu, Sep 02, 2004 at 01:10:40PM +0100, Peter Pimley wrote:
> Fixed it! :D

Great! I should have read further before posting that last message.


> ... what I didn't think was important enough to mention was that TableB 
> also has a foreign key to TableA, and that ClassB 'has_a' ClassA.

That's an interesting design that I've never seen. What's the reason for
cross-linking the tables like that? I've been using a has_many
relationship and retrieving all the TableB objects that match my TableA
id as described in my previous post. Is there some advantage you gain by
cross-linking like this?


> So, I had two classes that both had has_a relationships to each other.  
> The perl objects were being remembered by CDBI after I thought I was 
> done with them (across browser requests in a mod_perl environment).  I 
> obviously need to read up on perl references and garbage collection! :)

Are you storing these objects in global variables? If not, it seems to
me that CDBI should safely release them unless the processes are running
simultaneously and you are witnessing concurrency issues.


> I've hand-written the relevant method in one direction and it's all 
> working fine.

So do you still have two has_a relationships setup in your CDBI classes
or did you remove one?


William

        -- 
        Knowmad Services Inc.
http://www.knowmad.com

(message missing)

Deleting an object on the other side of a has_a
Peter Pimley 10:02 on 01 Sep 2004

Re: Deleting an object on the other side of a has_a
Perrin Harkins 16:09 on 01 Sep 2004

Re: Deleting an object on the other side of a has_a
Perrin Harkins 15:32 on 01 Sep 2004

Re: Deleting an object on the other side of a has_a
Perrin Harkins 16:33 on 01 Sep 2004

Re: Deleting an object on the other side of a has_a
Perrin Harkins 17:03 on 01 Sep 2004

Re: Deleting an object on the other side of a has_a
Perrin Harkins 16:42 on 01 Sep 2004

Re: Deleting an object on the other side of a has_a
Perrin Harkins 15:06 on 02 Sep 2004

Re: Deleting an object on the other side of a has_a
William McKee 14:57 on 02 Sep 2004

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