db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guy Galil <guy_ga...@guardium.com>
Subject Re: using a second database
Date Tue, 18 Apr 2006 18:54:59 GMT
All you need to do is change the url string in your torque.properties
file - each developer should have the url point to a different database:
as long as in your schema your database name is <db>
for developer 1
torque.dsfactory.<db>.connection.url
=jdbc:mysql://<someip>:<someport>/sandbox1

for developer 2
torque.dsfactory.<db>.connection.url
=jdbc:mysql://<someip>:<someport>/sandbox2

The database name in the schema and the objects is just a logical
pointer to the settings in the properties file.

On Tue, 2006-04-18 at 11:27 -0700, Helge Weissig wrote:
> On Apr 17, 2006, at 12:36 PM, Thomas Vandahl wrote:
> 
> > Yes, you can still do that. The name in the schema and the name in  
> > the Torque configuration have nothing to do with the real name of  
> > the database. This is usually specified in the JDBC-URL only. The  
> > other two names are just used to handle the matching of generated  
> > objects and configurations appropriately.
> >
> > I for example do this as well: The name of my schema is "turbine"  
> > and the name of my developer database is "testdb".
> 
> ok, so now I am confused! I played around with different settings and  
> I thought I had it down: The db name in the schema.xml file is  
> inserted into the create-db.sql script and into all generated  
> BasePeer objects and the configuration name in the Torque.properties  
> file needs to be the same as well. Hence, if we want folks to work in  
> their own sandbox, we would have to have
> 
> <database name="sandbox1">...</database>
> torque.database.default=sandbox1
> torque.dsfactory.sandbox1.factory=org.apache.torque.dsfactory.PerUserPoo 
> lDataSourceFactory
> torque.dsfactory.sandbox1. ...
> 
> I can see how you can work around that by enforcing manual creation  
> of the db though. Maybe the lesser of the two not-so-evils?
> 
> cheers,
> h.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 


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


Mime
View raw message