You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BATCH-2537: add support for @primary annotated data sources
Currently, when multiple data sources are defined in the context, an
IllegalStateException is thrown even if one of the data sources is
annotated with @primary (which should be the one to use).
This commit makes it possible to use the data source annotated with
@primary when multiple data sources are defined. Note that the context
initialization will still fail (with a UnsatisfiedDependencyException
from Spring's bean factory) if multiple data sources are defined and
none of them is annotated with @primary. If multiple data sources are
defined and none of them is annotated with @primary but one of them is
named "dataSource", this data source will be used by the batch
configuration due to autowiring by name (this detail has been documented
in the javadoc of @EnableBatchProcessing).
Resolves BATCH-2537
Copy file name to clipboardExpand all lines: spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/AbstractBatchConfiguration.java
+6-9Lines changed: 6 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2012-2013 the original author or authors.
2
+
* Copyright 2012-2018 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
Copy file name to clipboardExpand all lines: spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/EnableBatchProcessing.java
+9-2Lines changed: 9 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2012-2014 the original author or authors.
2
+
* Copyright 2012-2018 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
Copy file name to clipboardExpand all lines: spring-batch-core/src/test/java/org/springframework/batch/core/configuration/annotation/MapJobRepositoryConfigurationTests.java
0 commit comments