RE: Multiple DataNodes

From: Gentry, Michael \(Contractor\) ("Gentry,)
Date: Tue Feb 15 2005 - 15:35:33 EST

  • Next message: Sami Mohammed: "Driver Load Error"

    You could always break a join across two (or more) data nodes into separate queries, each feeding the next one. It would be cool if SelectQuery did that automatically, but it's certainly not a show stopper.

    /dev/mrg

    -----Original Message-----
    From: Andrus Adamchik [mailto:andru..bjectstyle.org]
    Sent: Tuesday, February 15, 2005 1:04 PM
    To: cayenne-use..bjectstyle.org
    Subject: Re: Multiple DataNodes

    If you search the archives, you may find some older discussions on the
    topic. I know of one limitation that was identified back then - queries
    that have to make joins across DataNodes will not work (it also means that
    regular relationships will work fine).

    E.g. (taking our artist/painting example, assuming Artist and Painting
    tables coming fro different DBs):

    // relationships will work
    artist.getPaintings();
    painting.getArtist();

    // one step qualifiers will work
    new SelectQuery(Painting.class, Expression.fromString("artist = ..));

    // *** multi-step qualifiers will break as they are translated to a join
    new SelectQuery(Painting.class, Expression.fromString("artist.name = 'a'"));

    Andrus

    > Good news. Never did such a thing, so I was a bit worried.
    >
    > Thanks Michael.
    >
    >
    > On Tue, 15 Feb 2005 11:28:12 -0500, Gentry, Michael (Contractor)
    > <michael_gentr..anniemae.com> wrote:
    >> I have a utility/admin application which uses multiple data nodes and
    >> I didn't really do anything special. Cayenne knows which DataNode
    >> (and therefore DB connection) to use by which DataDomain your
    >> DataContext is connected to and which Java classes (CayenneDataObject)
    >> you are using. So if you have a User in one DataNode and an Invoice
    >> in another, Cayenne will handle that just fine.
    >> Selects/inserts/updates/deletes will occur across the different
    >> connections and I believe (never tried it) that relationships across
    >> the different DBs will work fine, too.
    >>
    >> /dev/mrg
    >>
    >>
    >> -----Original Message-----
    >> From: Joćo Paulo Vasconcellos [mailto:vasconcello..mail.com]
    >> Sent: Tuesday, February 15, 2005 11:18 AM
    >> To: cayenne-use..bjectstyle.org
    >> Subject: Multiple DataNodes
    >>
    >> Hello list,
    >>
    >> I'm working with a legacy system that has information spread across
    >> 3 databases. My Apllication needs to access the 3 dataNodes. In the
    >> modeler, I created the 3 nodes, 3 maps and inported the db schema.
    >>
    >> My question is: Do I need any special treatment to work with 3
    >> different dataNodes? If so, what should I be aware of? Is there some
    >> placece in the docs where I can find it, aside from the customer ASP
    >> example (because I think this is a different setup)?
    >>
    >> Thanks,
    >> --
    >> Joćo Paulo Vasconcellos
    >> ICQ: 123-953-864
    >>
    >
    >
    > --
    > Joćo Paulo Vasconcellos
    > ICQ: 123-953-864



    This archive was generated by hypermail 2.0.0 : Tue Feb 15 2005 - 15:35:38 EST