tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicholas Sushkin <nsush...@openfinance.com>
Subject Re: Cleaning up after tomcat jdbc-pool?
Date Fri, 04 Mar 2011 15:59:35 GMT
On Thursday, March 03, 2011 19:24:11 Olivier Lefevre wrote:
> Can we see the relevant part of your context.xml, too?

Sure. It's something like:

<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="@deploy.path@">
  <Resource auth="Container" 
            connectionProperties="v$session.program=MyApp-@release@ @instance.title@;" 
            driverClassName="oracle.jdbc.driver.OracleDriver" 
            factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" 
            initialSize="1" 
            maxActive="10" 
            name="jdbc/Db1" 
            password="@db1.password@" 
            type="javax.sql.DataSource" 
            url="@db1.dburl@" 
            username="@db1.username@"/>
  <Resource auth="Container" connectionProperties="v$session.program=API-@release@ @instance.title@;"
driverClassName="oracle.jdbc.driver.OracleDriver" 
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" initialSize="1" maxActive="10" name="jdbc/Db2"
password="@db2.password@" type="javax.sql.DataSource" 
url="@db2.dburl@" username="@db2.username@"/>
</Context>

At build time, I run the file through ant target that replaces @*@ tokens with actual values.
I build using "ant -propertyfile myinstance.properties dist"

   <target name="-pre-dist">
       <replace dir="${build.web.dir}/WEB-INF"
                replacefilterfile="${instance.properties}"/>
       <replace dir="${build.web.dir}/META-INF"
                replacefilterfile="${instance.properties}"/>
   </target>
-- 
Nicholas Sushkin, Senior Software Engineer, Manager of IT Operations
Open Finance Aggregation eXchange <http://www.aggex.com>

Mime
View raw message