RE: Using multiple factories

From: Kim Limbrick (KLimbric..ngenuity.com)
Date: Tue Nov 01 2005 - 17:22:11 EST

  • Next message: Andrus Adamchik: "Re: Using multiple factories"

    Sure here's the code to get the data context that should use the
    DriverDataSourceFactory:

            DataContext ctxt =
    DataContext.createDataContext("IPACoreDomain");

    And here's the cayenne.xml file:

    <?xml version="1.0" encoding="utf-8"?>
    <domains project-version="1.1">
    <domain name="IPA">
            <map name="IPAMap" location="IPAMap.map.xml"/>

            <node name="IPANode"
                     datasource="IPANode.driver.xml"
            
    adapter="org.objectstyle.cayenne.dba.oracle.OracleAdapter"
                     factory="com.ipa.db.IPADataSourceFactory">
                            <map-ref name="IPAMap"/>
             </node>
    </domain>
    <domain name="IPACoreDomain">
            <map name="IPACoreMap" location="IPACoreMap.map.xml"/>

            <node name="IPACoreNode"
                     datasource="IPACoreNode.driver.xml"
            
    adapter="org.objectstyle.cayenne.dba.oracle.OracleAdapter"
            
    factory="org.objectstyle.cayenne.conf.DriverDataSourceFactory">
                            <map-ref name="IPACoreMap"/>
             </node>
    </domain>
    </domains>

    -- Kim Limbrick

    -----Original Message-----
    From: Andrus Adamchik [mailto:andru..bjectstyle.org]
    Sent: Tuesday, November 01, 2005 12:17 PM
    To: cayenne-deve..bjectstyle.org
    Subject: Re: Using multiple factories

    Kim,

    Could you possibly send your cayenne.xml file and post some sample code
    on how you obtain a DataContext in your app. Otherwise it is hard to
    tell what goes wrong here.

    Andrus

    P.S. this message is probably more on topic for cayenne-user list..

    On Nov 1, 2005, at 8:39 PM, Kim Limbrick wrote:

    > I am trying to setup two domains each with their own data source
    > factory. One domain uses my own data source factory which extends
    > DriverDataSourceFactory and the other uses DriverDataSourceFactory.
    > It appears that all requests for a data context ends up using my
    > factory regardless of what domain is specified. Is there any trick to
    > getting multiple factories to work?
    >
    > -- Kim Limbrick
    >

    ----+----
    This email message (and any attached document) contains information from Ingenuity Systems Inc. which may be considered confidential by Ingenuity, or which may be privileged or otherwise exempt from disclosure under law, and is for the sole use of the individual or entity to whom it is addressed. Any other dissemination, distribution or copying of this message is strictly prohibited. If you receive this message in error, please notify me and destroy the attached message (and all attached documents) immediately.



    This archive was generated by hypermail 2.0.0 : Tue Nov 01 2005 - 17:22:13 EST