I am trying to stop the Spring batch job and below is the code.
@SuppressWarnings("deprecation")
@Override
public void beforeJob(JobExecution jobExecution) {
//Job stop changes start
jobExecution.setExitStatus(ExitStatus.FAILED);
try {
jobOperator.stop(jobExecution.getId());
} catch (NoSuchJobExecutionException | JobExecutionNotRunningException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
MDC.put(JOB_ID_KEY, jobId);
blastManager.setJobStarted(jobId);
}
When I try to ran the code and seeing below Multiple Transaction Management Exception.Please help me to fix the exception.
.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type '.springframework.transaction.TransactionManager' available: expected single matching bean but found 3: omsTransactionManager,oracleTransactionManager,transactionManager
at .springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1273)
at .springframework.beans.factory.support.DefaultListableBeanFactory.resolveBean(DefaultListableBeanFactory.java:494)
at .springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:349)
at .springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:342)
Please help to fix multiple Transaction Management issue.