Skip to content

Commit 5352468

Browse files
committed
Adapt to breaking transaction manager change in Spring Batch
See gh-32237 See spring-projects/spring-batch#4130
1 parent 0f9ff86 commit 5352468

File tree

1 file changed

+6
-1
lines changed
  • spring-boot-project/spring-boot-cli/samples

1 file changed

+6
-1
lines changed

spring-boot-project/spring-boot-cli/samples/job.groovy

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.test
22

3+
import org.springframework.transaction.TransactionManager
4+
35
@Grab("hsqldb")
46
@Configuration(proxyBeanMethods = false)
57
@EnableBatchProcessing
@@ -10,6 +12,9 @@ class JobConfig {
1012

1113
@Autowired
1214
private StepBuilderFactory steps
15+
16+
@Autowired
17+
private TransactionManager transactionManager
1318

1419
@Bean
1520
protected Tasklet tasklet() {
@@ -28,6 +33,6 @@ class JobConfig {
2833

2934
@Bean
3035
protected Step step1() throws Exception {
31-
return steps.get("step1").tasklet(tasklet()).build()
36+
return steps.get("step1").tasklet(tasklet()).transactionManager(this.transactionManager).build()
3237
}
3338
}

0 commit comments

Comments
 (0)