You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by to...@db.apache.org on 2004/05/17 20:07:39 UTC

[DB Torque Wiki] Updated: GettingTorqueToWork

   Date: 2004-05-17T11:07:39
   Editor: 67.166.116.227 <>
   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 @@
   SomePeer.doDelete(criteria);
 }}}
 
-
-[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).
--B.Yu.]
 
 -- Gary Shea

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