Multiple Transaction manager issue
I have some doubts regarding the multiple transaction manager issue, I have two spring config file defined two spring configuration manager.
One file
Code:
<tx:advice id="txAdvice" transaction-manager="transactionManager1">
<bean id="transactionManager1" class="org.springframework.jdbc.DataSourceTransactionManager">
...
</bean>
Another file
Code:
<tx:advice id="txAdvice" transaction-manager="transactionManager2">
<bean id="transactionManager2" class="org.springframework.jdbc.DataSourceTransactionManager">
...
</bean>
Both of them was loaded into spring context, Now I have a service class, I didn't use the qulifier to indicate the transaction manager to use, I am wondering which transaction manager spring will going to use. Randomly pick up one or what?
Code:
public class TransactionalService {
@Transactional
public void setSomething(String name) { ... }
@Transactional
public void doSomething() { ... }
}