Re: Sharing a single DataMap between multiple DataNodes

From: Bryan Lewis (brya..aine.rr.com)
Date: Tue Sep 06 2005 - 11:41:53 EDT

  • Next message: Gili: "Re: Getting up and running"

    Here's what I do. The configName is the name of the cayenne.xml file, like
    for me "dev.cayenne.xml" or "prod.cayenne.xml". I put all my cayenne.xml's
    in the root of my jar file.

        private static synchronized Configuration getConfiguration(String
    configName)
        {
            Configuration config;

            if (!initializedConfiguration) {
                initializedConfiguration = true;

                log.debug("Initializing configuration " + configName);

                config = new DefaultConfiguration(configName);
                Configuration.initializeSharedConfiguration(config);
            }
            else {
                config = Configuration.getSharedConfiguration();
            }

            return config;
        }

    ----- Original Message -----
    From: "Gili" <cowwo..bs.darktech.org>
    To: <cayenne-use..bjectstyle.org>
    Sent: Tuesday, September 06, 2005 11:10 AM
    Subject: Re: Sharing a single DataMap between multiple DataNodes

    > Bryan Lewis wrote:
    > > * Multiple cayenne.xml files sharing the same DataMap. See fopr example:
    > >
    > >
    http://article.gmane.org/gmane.comp.java.cayenne.user/2972/match=defaultconfiguration
    >
    > Hi Bryan,
    >
    > I didn't understand how to use DefaultConfiguration as mentioned in
    > this email. How do I tell Cayenne on startup to read Cayenne.xml from a
    > non-default path? I think it's expecting it at a root in the CLASSPATH
    > but I've got it elsewhere.
    >
    > Thanks,
    > Gili



    This archive was generated by hypermail 2.0.0 : Tue Sep 06 2005 - 11:42:05 EDT