turbine-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Vandahl ...@apache.org>
Subject Re: Turbine 2.3.3 - change database url based on environment (QA, TEST, etc.)
Date Thu, 08 Sep 2011 19:44:44 GMT
On 08.09.11 14:38, mrab wrote:
>       So now I would like to do it the proper way, whatever that is!  I
> looked at configuration-howto.html which allows configuring the
> TurbineResources.properties file.  However, the database url is now in
> torque.properties.  Is there some way to use this method anyway?  Or what is
> the best way to accomplish this?

(This is actually a Torque question, the correct mailing list would be
torque-user@db.apache.org)

My suggestion would be to use a JNDI pool. See

http://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html#JDBC_Data_Sources


on how to configure this in Tomcat. I suggest to put the configuration
into server.xml-><GlobalNamingResources> and use a ResourceLink-Element
in your context file to map the global data source to your local name. See

http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Resource%20Links
on how that works.

If you have that running, see the description of the
JndiDataSourceFactory at

http://db.apache.org/torque/releases/torque-3.3/runtime/reference/initialisation-configuration.html

on how to configure Torque.

You would have the option to use the ResourceLink element in your
context file to map your data source name (jdbc/DB) to the global ones
(jdbc/DBQA, jdbc/DBTEST). That would require redeployment of your
application on a change.

The other way would be to set a system property into the server.xml
Resource definition like ${database.url} and start Tomcat with -D
database.url=jdbc:whatever. See

http://java-monitor.com/forum/showthread.php?t=838

for an example.

HTH.

Bye, Thomas.

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


Mime
View raw message