Re: Sharing a single DataMap between multiple DataNodes

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Sep 06 2005 - 11:02:20 EDT

  • Next message: Mike Kienenberger: "Re: DataContext.invalidateObjects vs unregisterObjects"

    This is not an artificial limitation, this is how Cayenne works! If
    the same DataMap is linked to more than one DataNode, when you
    execute a query for a given entity, Cayenne wouldn't know what db to
    send it to...

    In other words if you have some logic that requires the same map to
    be associated with different nodes based on some condition, you'd
    have to create multiple DataDomains. Each domain would work as an
    isolated namespace. The only limitation now is that you can't link
    the same map to two domains in the Modeler, so you'd have to do it in
    the code.

    But 1.2 introduces an even cooler solution for JNDI vs. explicit
    driver configuration problem:

    http://objectstyle.org/confluence/display/CAY/1.2+User+Guide

    (see "Loading JNDI DataNodes from Local Preferences" article).

    Andrus

    On Sep 6, 2005, at 10:43 AM, Bryan Lewis wrote:

    > There's no requirement that a DataMap be associated with only one
    > DataNode.
    > Perhaps it appears that way in the Modeler, don't know about that,
    > but the
    > xml files are easily to edit. I've used both of the following ways:
    >

    >>
    >> I want to be able to access the same database using JDBC from
    >> standalone applications and JNDI when running inside Tomcat. It is
    >> possible for both to be used simultaneously. Modeler seems to improve
    >> the artificial limitation that a DataMap may be associated with at
    >> most
    >> a single DataNode. Is there possible to remove this limitation or is
    >> there a workaround



    This archive was generated by hypermail 2.0.0 : Tue Sep 06 2005 - 11:02:23 EDT