db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frederic Gedin <frederic.ge...@Jaluna.COM>
Subject Re: Map objects to different databases
Date Fri, 25 Apr 2003 06:30:26 GMT
Hi Malte

Malte Stien wrote:

>>Reading your Torque.properties extract, I do not see the cause of your
>>problem: it looks like mine except that I use MySQL instead of postgres.
>Do you use two databases during runtime as well?
Yes I do. But I ask Torque to generate only one, the other coming from 
an other application.

>>  - are you sure you do not have java class names which conflict between
>>the project and the master databases?
>>  - are you sure that no error or exception message has been generated
>>at build time?
>I do not have any compilation errors. My problem is not, that I cannot compile 
>the code or that Torque does not generate the Java code correctly. The 
>problem is just, that Torque does not generate initialization code (i.e. the 
>sql script) to setup two databases. So, it will not use two databases during 
>runtime as well. I just want to convince Torque, that some of the tables are 
>in the project database and others are in the project master database. Torque 
>has to consider that for the database generation as well as for the database 
>runtime usage. But at the moment the first step already fails.
Now I understand your problem.  I have to tell that I faced the same 
problem: Torques refuses to build two separate databases.  I did not 
investigate further because, I my case, I just really need to build one.

I am sorry not being able to really help you on this.  The only advice I 
could give is to give up trying to build your two databases using Torque 
for now and continue your application development: regarding the om 
generation and the runtime, it should work fine.
To do this you will need to update the following Torque configuration 
torque.schema.sql.excludes  = <the database you will build manually>
torque.schema.create-db.excludes = id-table-schema.xml, <the database 
you will build manually>
torque.schema.init-sql.excludes = <the database you will build manually>

Another idea I just have (but I did not test it): go to your 
build-torque.xml file, and update the sql target to require for building 
the second database
<antcall target="sql-classpath-dbmaster"/>  
<antcall target="sql-classpath-dbproj"/>  

And of course build the target sql-classpath-dbmaster and 
sql-classpath-dbproj according to the model sql-classpath



View raw message