db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anuradha S.Athreya" <anuradh...@world2web.com>
Subject Creating common connection pool
Date Fri, 02 Dec 2005 10:20:47 GMT
I am trying to configure connection pooling using Torque for 2 web
applications deployed in the same tomcat container but in 2 different
contexts,connecting to the same DB.

Doubt 1: Where should the Torque.properties file be located? Obviously, the
path of this file has to be with reference to a servlet context. Since I
want to create a common connection, which one of the 2 servlet context will
contain the properties file?

I made changes to the Tomcat server.xml file : 

<Context path="/myApp1" docBase="D:/jakarta-tomcat-5.0.18/webapps/myApp1" >
				    <Resource name="jdbc/myApp1"
scope="Shareable" type="javax.sql.DataSource"/>
				    <ResourceParams name="jdbc/myApp1">
				        <!-- DBCP database connection
settings -->
				        <!-- DBCP connection pooling options

Under normal circumstances, since i place the war files of the application,
I dont specify the CONTEXT explicitly in the server.xml file. But since. I
need to place RESOURCE, here I added the CONTEXT tag. 
Since, I have 2 web applications deployed, will I have to repeat the CONTEXT
tag again for my 'myApp2'??

I have also made changes to the Tomcat web.xml file..

      <description>DB Connection</description>

Next comes the connection part....

Will Tomcat itself perform Torque.init()? 

If not, where should this be done, so that the Torque initialisation happens
common to both the applications??

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message