Commit 19ca4d4e authored by Dave Syer's avatar Dave Syer

Add destroyMethods to DataSources

parent c5584b49
......@@ -47,7 +47,7 @@ public class CommonsDataSourceConfiguration extends AbstractDataSourceConfigurat
setInitialSize(0);
}
@Bean
@Bean(destroyMethod = "close")
public DataSource dataSource() {
logger.info("Hint: using Commons DBCP BasicDataSource. It's going to work, "
+ "but the Tomcat DataSource is more reliable.");
......
......@@ -36,7 +36,8 @@ public enum EmbeddedDatabaseConnection {
/**
* H2 Database Connection.
*/
H2(EmbeddedDatabaseType.H2, "org.h2.Driver", "jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1"),
H2(EmbeddedDatabaseType.H2, "org.h2.Driver",
"jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE"),
/**
* Derby Database Connection.
......
......@@ -34,7 +34,7 @@ public class TomcatDataSourceConfiguration extends AbstractDataSourceConfigurati
private org.apache.tomcat.jdbc.pool.DataSource pool;
@Bean
@Bean(destroyMethod = "close")
public DataSource dataSource() {
this.pool = new org.apache.tomcat.jdbc.pool.DataSource();
this.pool.setDriverClassName(getDriverClassName());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment