We have an app which defines JNDI resources inside spring [dataAccess.xml] asand uses both JDBC template and StoreProcedure data access. In addition, we define data sources [db] inside our tomcat configuration file [as found in ~/tomcat/conf/Catalina/localhost/xxx.xml] using DBCP:Code:org.springframework.jndi.JndiObjectFactoryBean
The issue we run into is if we redeploy to tomcat by copying the WAR file into the webapps directory, the old connections to the database are not detroyed. I know that if I define the datasource within spring, I can specify the destroy method, however this is not acceptable since we've several environments in which to run this app.Code:. . . <ResourceParams name="jdbc/xxxDS"> <parameter> <name>factory</name> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value> </parameter> <parameter> <name>driverClassName</name> <value>oracle.jdbc.driver.OracleDriver</value> </parameter> . . .
Springframework 1.1.5
DBCP 1.2.1
Tomcat 5.0.28
Any ideas on how to solve this issue? Since we useI was thinking of subclassing it and having it invoke the dbcp's destroy....of course there's getting hold of the dbcp object....Code:org.springframework.web.servlet.DispatcherServlet
Thanks.


Reply With Quote