We're having a disagreement in the office about the JNDI datasources.  We're
running Tomcat 6 and using the built-in DBCP as our connection pool.  DBCP
is configured in the server's context.xml.  Our webapp gets a datasource
using JNDI via Spring JDBC.

There are two schools of thought on the team.  One says we should close the
datasource in a listener's contextDestroyed, something like this:

((BasicDataSource)datasource).close();

 The other school of thought says that's not necessary, since Tomcat is
managing the data source and the resource is not instantiated in the
listener's contextInitialized method.

  What's the right answer?  I haven't seen anything that says one way or the
other.

Thanks,

Paul

Reply via email to