db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject Re: svn commit: r571790 - in /db/torque/runtime/trunk/src/java/org/apache/torque: TorqueInstance.java manager/AbstractBaseManager.java
Date Fri, 07 Sep 2007 12:25:49 GMT
Thomas Vandahl wrote:

> It's obviously difficult to make myself clear. This very Torque feature
> is documented and works so that the meaning of the database/datasource
> "default" can be routed to one of the existing database definitions. Why
> doesn't that make sense? I'll try an example.
>
> ---8<---
> torque.database.turbine.adapter=mysql
>
torque.dsfactory.turbine.factory=org.apache.torque.dsfactory.JndiDataSourceFactory

>
> torque.dsfactory.turbine.jndi.path=java:/comp/env/jdbc/Turbine
> torque.dsfactory.turbine.jndi.ttl=300000
>
> torque.database.myapp.adapter=mysql
>
torque.dsfactory.myapp.factory=org.apache.torque.dsfactory.JndiDataSourceFactory

> torque.dsfactory.myapp.jndi.path=java:/comp/env/jdbc/MyApp
> torque.dsfactory.myapp.jndi.ttl=300000
> ---8<---
>
> If I now generate OM classes for the database name "default", I can
> decide - via configuration - which of the two database definitions to
> use by simply setting
>
> torque.database.default=turbine
>
> or
>
> torque.database.default=myapp
>
> How would I achieve this without the feature discussed?
>

Ok, now I see your point. Sorry for my blocked thougts :-(. I'm now +1 for
the change.

> ...
> > In this section, it says if you do not set the "name" attribute in the
> > schema.xml, the generator will set it to be "default". It does not say
> > anything about references during runtime.
>
> It does.
> ---8<---
> As Torque has the ability to use multiple databases you can tell it
> which one to use by default thus...
>
> torque.database.default=bookstore
> ---8<---
> ...

I'd just add a sentence saying:

The name "default" should not be used as a name for a physical database in
the configuration, because Torque uses the database name "default" as a
reference to the default database.

No need for you to do this, I have bothered you enough.

    Thomas




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


Mime
View raw message