Hi Mike,

it should be possible to use multiple JDOManager instances for multiple
databases. A jdo-conf may look as follows:

<?xml version="1.0" ?>
<!DOCTYPE jdo-conf
  PUBLIC "-//EXOLAB/Castor JDO Configuration DTD Version 1.0//EN"
         "http://castor.org/jdo-conf.dtd";>

<jdo-conf>
    <database name="mysql-database1" engine="mysql" >
        <driver url="jdbc:mysql://localhost:3306/db1"
                class-name="com.mysql.jdbc.Driver">
            <param name="user" value="test" />
            <param name="password" value="test" />
        </driver>
        <mapping href="jdo/mapping.xml" />
    </database>
    <database name="mysql-database2" engine="mysql" >
        <driver url="jdbc:mysql://localhost:3306/db2"
                class-name="com.mysql.jdbc.Driver">
            <param name="user" value="test" />
            <param name="password" value="test" />
        </driver>
        <mapping href="jdo/mapping.xml" />
    </database>
    <database name="oracle-database1" engine="oracle" >
        <data-source
            class-name="oracle.jdbc.pool.OracleConnectionCacheImpl">
            <param name="URL"
                   value="jdbc:oracle:thin:@localhost:1521:DB1" />
            <param name="user" value="test" />
            <param name="password" value="secret" />
            <param name="min-limit" value="5" />
            <param name="max-limit" value="10" />
            <param name="cache-scheme" value="1" />
        </data-source>
        <mapping href="jdo/mapping.xml" />
    </database>
    <database name="oracle-database2" engine="oracle" >
        <data-source
            class-name="oracle.jdbc.pool.OracleConnectionCacheImpl">
            <param name="URL"
                   value="jdbc:oracle:thin:@localhost:1521:DB2" />
            <param name="user" value="test" />
            <param name="password" value="secret" />
            <param name="min-limit" value="5" />
            <param name="max-limit" value="10" />
            <param name="cache-scheme" value="1" />
        </data-source>
        <mapping href="jdo/mapping.xml" />
    </database>
    <transaction-demarcation mode="local" />
</jdo-conf>

Creation and access to these instances is similar to using only one
database.

Having said that there is also an option to load multiple jdo-conf files
with different database definitions and differnent modes for transaction
demarcation.

Regards
Ralf


Mike Wannamaker schrieb:
> I need to be able to have multiple JDOManagers?  In previous work I used an
> AbstractDataItem that used a helper class to create/update/delete objects
> and this worked great.  This was very nice, but I only had 1 JDOManager, 1
> database then.  Now I have the possibility to having multiple databases and
> multiple configurations.  I'm going to create a datasource to hook into our
> own pooling, but I'm not sure how to go about using the same kind of
> AbstractDataItem class as I won't have the luxury of a static JDO.
> 
> 
> For example: 
> 
> MySQL
>       -> database1
>       -> database2
> Oracle
>       -> database3
>       -> database4
> 
> 
> Any help or ideas would be helpful.
> 
> --ekiM
> Aoccdrnig to rscheearch at an Elingsh uinervtisy, it deosn't mttaer in waht
> oredr the ltteers in a wrod are, the olny iprmoatnt tihng is taht the frist
> and lsat ltteer is at the rghit pclae. The rset can be a toatl mses and you
> can sitll raed it wouthit porbelm. Tihs is bcuseae we do not raed ervey
> lteter by it slef but the wrod as a wlohe. 
> 
> -------------------------------------------------
> If you wish to unsubscribe from this list, please 
> send an empty message to the following address:
> 
> [EMAIL PROTECTED]
> -------------------------------------------------

-- 

Syscon Ingenieurbüro für
Meß- und Datentechnik GmbH
Ralf Joachim
Raiffeisenstraße 11
D-72127 Kusterdingen
Germany

Tel.   +49 7071 3690 52
Mobil: +49 173 9630135
Fax    +49 7071 3690 98

Email: [EMAIL PROTECTED]
Web:   www.syscon-world.de

-------------------------------------------------
If you wish to unsubscribe from this list, please 
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to