Have 2 Transaction Mangers as follows
<bean id="transactionManager1"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource1" />
</bean>
<bean id="transactionManager2"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource2" />
</bean>
Both are the registered to AspectJ AnnotationTransactionManager as follows
<bean class="org.springframework.transaction.aspectj.AnnotationTransactionAspect" factory-method="aspectOf">
<property name="transactionManager" ref="transactionManager1" />
</bean>
<bean class="org.springframework.transaction.aspectj.AnnotationTransactionAspect" factory-method="aspectOf">
<property name="transactionManager" ref="transactionManager2" />
</bean>
and transaction enabled using annotations as follows-
<tx:annotation-driven transaction-manager="transactionManager1" mode="aspectj" />
<tx:annotation-driven transaction-manager="transactionManager2" mode="aspectj" />
This causes setting of transactionManager property of Abstract class - 'org.springframework.transaction.interceptor.TransactionAspectSupport to the last annotation transaction aspect bean created during server startup.
However not able to select TransactionManager at runtime using qualifiers. Does org.springframework.transaction.aspectj.AnnotationTransactionAspect asllow multiple transaction Managers?