RE: Should localObject() traverse the whole graph?

From: Kevin Menard (kmenar..ervprise.com)
Date: Fri May 18 2007 - 13:13:28 EDT

  • Next message: Andrus Adamchik: "Re: Should localObject() traverse the whole graph?"

    > -----Original Message-----
    > From: Andrus Adamchik [mailto:andru..bjectstyle.org]
    > Sent: Friday, May 18, 2007 12:40 PM
    > To: use..ayenne.apache.org
    > Subject: Re: Should localObject() traverse the whole graph?
    >
    > Hi Kevin,
    >
    > 'localObject' is not moving objects, between contexts.
    > Instead it locates an object counterpart (another copy) in
    > the target context, instantiating a fault if needed. In light
    > of that your question about graph traversal is probably not relevant.
    >
    > Andrus

    Alright, looking at the implementation of localObject, it makes a lot
    more sense what's going on now. I guess I should have done that first.
    The section in the docs titled "Moving Objects Between Contexts" may be
    better named as well.

    So, if this is the appropriate behavior, is there a means of "moving" a
    whole graph to a new DC? The best I could come up with is iterating
    over the second DC's registered nodes and calling localObject() on them,
    but that still seems to require re-establishing the relationship arcs.

    This exercise is now more academic than anything else. I've got another
    solution that works. But I've been finding that as I add more DCs with
    non-trivial workflows, there's a lot of hoops to jump through to prevent
    early commits of incomplete data. Maybe the correct solution is to
    finally make it possible to associate two unregistered data objects and
    then only bring the DC into the mix once the data is all set . . .

    -- 
    Kevin
    



    This archive was generated by hypermail 2.0.0 : Fri May 18 2007 - 13:14:10 EDT