|
|
@ -1,5 +1,7 @@
|
|
|
|
package org.test
|
|
|
|
package org.test
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.transaction.TransactionManager
|
|
|
|
|
|
|
|
|
|
|
|
@Grab("hsqldb")
|
|
|
|
@Grab("hsqldb")
|
|
|
|
@Configuration(proxyBeanMethods = false)
|
|
|
|
@Configuration(proxyBeanMethods = false)
|
|
|
|
@EnableBatchProcessing
|
|
|
|
@EnableBatchProcessing
|
|
|
@ -10,6 +12,9 @@ class JobConfig {
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private StepBuilderFactory steps
|
|
|
|
private StepBuilderFactory steps
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private TransactionManager transactionManager
|
|
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
@Bean
|
|
|
|
protected Tasklet tasklet() {
|
|
|
|
protected Tasklet tasklet() {
|
|
|
@ -28,6 +33,6 @@ class JobConfig {
|
|
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
@Bean
|
|
|
|
protected Step step1() throws Exception {
|
|
|
|
protected Step step1() throws Exception {
|
|
|
|
return steps.get("step1").tasklet(tasklet()).build()
|
|
|
|
return steps.get("step1").tasklet(tasklet()).transactionManager(this.transactionManager).build()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|