db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From torque-...@db.apache.org
Subject [DB Torque Wiki] Updated: GettingTorqueToWork
Date Mon, 17 May 2004 18:07:39 GMT
   Date: 2004-05-17T11:07:39
   Editor: <>
   Wiki: DB Torque Wiki
   Page: GettingTorqueToWork
   URL: http://wiki.apache.org/db-torque/GettingTorqueToWork

   no comment

Change Log:

@@ -241,6 +241,8 @@
 This section deals with the trials and tribulations of using multiple databases with Torque.
+By 'multiple databases', I mean the use case where there are (conceivably) multiple distinct
database engines, each of which hosts one or more databases, all or many of which have distinct
schema.  We wish to access multiple databases from this environment from within a particular
JVM/classloader/class, during a single run of the program.  This tortured description brought
to you in hopes of being very clear on what this HOWTO is for.  Thanks to B. Yu for pointing
out a possibile ambiguity.  [I have removed his note as I believe it could be confusing, no
insult intended!]
 It's fairly easy to get multiple databases working.  The following examples assume you are
using JNDI, since it's what I know best, but the differences are restricted to the torque.properties
file. Start off by choosing a ''handle'' name for each of the databases to which you will
connect.  In this example there will be two databases, with handles '''dbA''' and '''dbB'''.
 Do the following:
  1. In the schema file for '''dbA''', the <database> element must have a ''name'' attribute
with value '''dbA'''.  Likewise for the '''dbB''' schema file.  When the object model files
are generated (by ''ant -f build.properties om''), the name will be hard-coded in them, and
cannot be overriden.
@@ -269,8 +271,5 @@
-[Note: When I first read this I was confused about the intended message of the author. At
first, I thought it was a how-to for accessing different schemas stored in different databases.
 Then it dawned on me after little experimentation. I think the intended message was that
a peer can access a database different than the one specified by the database name attribute
in the schema xml file (with the restriction that the same table actually exists in the target
DB, dbA and dbB).
 -- Gary Shea

To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org

View raw message