Add transaction support in JobExplorerFactoryBean

This commit adds support to create a transactional
proxy around the JobExplorer created by the
JobExplorerFactoryBean.

Resolves #1307
This commit is contained in:
Mahmoud Ben Hassine
2022-09-21 02:49:09 +02:00
parent 0a71cb7d93
commit 40b4be3c14
20 changed files with 105 additions and 20 deletions

View File

@@ -33,11 +33,7 @@
<bean id="notificationPublisher" class="org.springframework.batch.sample.jmx.JobExecutionNotificationPublisher" />
<bean id="jobRegistry" class="org.springframework.batch.core.configuration.support.MapJobRegistry" />
<bean id="jobOperator" class="org.springframework.batch.core.launch.support.SimpleJobOperator">
<property name="jobExplorer">
<bean class="org.springframework.batch.core.explore.support.JobExplorerFactoryBean">
<property name="dataSource" ref="dataSource" />
</bean>
</property>
<property name="jobExplorer" ref="jobExplorer"/>
<property name="jobRepository" ref="jobRepository" />
<property name="jobRegistry" ref="jobRegistry" />
<property name="jobLauncher">

View File

@@ -27,7 +27,7 @@
<bean id="jobExplorer"
class="org.springframework.batch.core.explore.support.JobExplorerFactoryBean"
p:dataSource-ref="dataSource" />
p:dataSource-ref="dataSource" p:transactionManager-ref="transactionManager"/>
<bean id="jobRegistry"
class="org.springframework.batch.core.configuration.support.MapJobRegistry" />

View File

@@ -18,7 +18,7 @@
p:jobExplorer-ref="jobExplorer" p:jobRepository-ref="jobRepository" p:jobRegistry-ref="jobRegistry" />
<bean id="jobExplorer" class="org.springframework.batch.core.explore.support.JobExplorerFactoryBean"
p:dataSource-ref="dataSource" />
p:dataSource-ref="dataSource" p:transactionManager-ref="transactionManager"/>
<bean class="org.springframework.batch.core.configuration.support.AutomaticJobRegistrar">
<property name="applicationContextFactories">