From 3513f3316da8da6a76e572fa6c21b3e1a70a140b Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 28 Mar 2018 09:04:48 +0300 Subject: server: trying to do clean shutdown of DataSource --- .../src/main/java/com/juick/configuration/DataConfiguration.java | 2 +- .../src/main/java/com/juick/configuration/SearchConfiguration.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'juick-server-jdbc') diff --git a/juick-server-jdbc/src/main/java/com/juick/configuration/DataConfiguration.java b/juick-server-jdbc/src/main/java/com/juick/configuration/DataConfiguration.java index 78c6e1d6..9f59f965 100644 --- a/juick-server-jdbc/src/main/java/com/juick/configuration/DataConfiguration.java +++ b/juick-server-jdbc/src/main/java/com/juick/configuration/DataConfiguration.java @@ -53,7 +53,7 @@ public class DataConfiguration implements TransactionManagementConfigurer { // NOTE: The close() method will be called automatically with default @Bean settings // But Datasource interface has no close() method - @Bean + @Bean(destroyMethod = "") public DataSource dataSource() { BasicDataSource dataSource = new BasicDataSource(); diff --git a/juick-server-jdbc/src/main/java/com/juick/configuration/SearchConfiguration.java b/juick-server-jdbc/src/main/java/com/juick/configuration/SearchConfiguration.java index 70461c91..26b5f888 100644 --- a/juick-server-jdbc/src/main/java/com/juick/configuration/SearchConfiguration.java +++ b/juick-server-jdbc/src/main/java/com/juick/configuration/SearchConfiguration.java @@ -24,7 +24,6 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.DependsOn; -import org.springframework.context.annotation.PropertySource; import org.springframework.core.env.Environment; import javax.annotation.Resource; @@ -39,7 +38,7 @@ public class SearchConfiguration { // NOTE: The close() method will be called automatically with default @Bean settings // But Datasource interface has no close() method - @Bean + @Bean(destroyMethod = "") public BasicDataSource searchDataSource() { BasicDataSource dataSource = new BasicDataSource(); -- cgit v1.2.3