From 26fc468eb2eff7465d59259040ba895b64097caa Mon Sep 17 00:00:00 2001 From: Taeik Lim Date: Sat, 27 Mar 2021 02:50:52 +0900 Subject: [PATCH] Use getDataSource method in DefaultBatchConfigurer --- .../core/configuration/annotation/DefaultBatchConfigurer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/DefaultBatchConfigurer.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/DefaultBatchConfigurer.java index 986419fee..78b9c1267 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/DefaultBatchConfigurer.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/DefaultBatchConfigurer.java @@ -115,7 +115,7 @@ public class DefaultBatchConfigurer implements BatchConfigurer { protected JobRepository createJobRepository() throws Exception { JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean(); - factory.setDataSource(this.dataSource); + factory.setDataSource(getDataSource()); factory.setTransactionManager(getTransactionManager()); factory.afterPropertiesSet(); return factory.getObject(); @@ -123,7 +123,7 @@ public class DefaultBatchConfigurer implements BatchConfigurer { protected JobExplorer createJobExplorer() throws Exception { JobExplorerFactoryBean jobExplorerFactoryBean = new JobExplorerFactoryBean(); - jobExplorerFactoryBean.setDataSource(this.dataSource); + jobExplorerFactoryBean.setDataSource(getDataSource()); jobExplorerFactoryBean.afterPropertiesSet(); return jobExplorerFactoryBean.getObject(); }