0 Background introduction
Two data sources are used in the project and two transaction templates are opened.
1 error protection information
org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type ‘org.springframework.transaction.support.TransactionTemplate’ available: expected single matching bean but found 2: secondTransactionTemplate ,thereTransactionTemplate
2 solutions
@Autowired
private TransactionTemplate secondTransactionTemplate;
@Resource(name = "thereTransactionTemplate")
private TransactionTemplate thereTransactionTemplate;
Use @Resource to specify.