In the application context declare the following:-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<tx:annotation-driven transaction-manager="txManager" /> <bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> </bean> <tx:annotation-driven transaction-manager="txManagerDiscussion" /> <bean id="txManagerDiscussion" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSourceDiscussion" /> <qualifier value="discussionTxManager"/> </bean> |
In the Java code do the following as shown below as code snippet:-
1 2 3 |
@Transactional("discussionTxManager") public void someMethod(..) {..} |
Page Visitors: 4545