Update. Apparently, Tomcat, starting from 7.0.11, closes the DataSource for you, so it is not available in the webappdestroyed context. See: https://issues.apache.org/bugzilla/show_bug.cgi?id=25060
Hi,
I am using Spring 3.0 and Java 1.6.
If I get the data source this way:
<bean id="dataSource" class="my.data.Source" destroy-method="close"> <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/> <property name="url" value="jdbc:oracle:thin:@localhost:1521:home"/> <property name="username" value="user"/> <property name="password" value="pw"/> </bean>
then the data source is closed when the bean is destroyed.
If I get the data source as follows:
<jee:jndi-lookup id="dataSource" jndi-name="java:comp/env/jdbc/db" />
then do i need to explicitly close the data source in my context? Sophisticated listener?
Thanks,
Floor
spring spring-jdbc tomcat7 datasource jndi
Paul
source share