Hi
I have spring file -
<bean id="transactionManager01" class="org.springframework.jdbc.datasource.DataSou rceTransactionManager">
<property name="dataSource" ref="dataSource01"/>
</bean>
<!-- the transactional advice bean below) -->
<!-- the transactional semantics... -->
<tx:advice id="txAdvice01" transaction-manager="transactionManager01">
<tx:attributes>
<tx:method name="storeLhrSendData" propagation="REQUIRES_NEW" />
<tx:method name="storeLhrRecieveData" propagation="REQUIRES_NEW" />
</tx:attributes>
</tx:advice>
<bean id="transactionManager02" class="org.springframework.jdbc.datasource.DataSou rceTransactionManager">
<property name="dataSource" ref="dataSource02"/>
</bean>
<tx:advice id="txAdvice02" transaction-manager="transactionManager02">
<tx:attributes>
<tx:method name="storeLhrSendData" propagation="REQUIRES_NEW" />
<tx:method name="storeLhrRecieveData" propagation="REQUIRES_NEW" />
</tx:attributes>
</tx:advice>
<bean id="transactionManager03" class="org.springframework.jdbc.datasource.DataSou rceTransactionManager">
<property name="dataSource" ref="dataSource03"/>
</bean>
<tx:advice id="txAdvice03" transaction-manager="transactionManager03">
<tx:attributes>
<tx:method name="storeLhrSendData" propagation="REQUIRES_NEW" />
<tx:method name="storeLhrRecieveData" propagation="REQUIRES_NEW" />
</tx:attributes>
</tx:advice>
<bean id="transactionManager04" class="org.springframework.jdbc.datasource.DataSou rceTransactionManager">
<property name="dataSource" ref="dataSource04"/>
</bean>
<tx:advice id="txAdvice04" transaction-manager="transactionManager04">
<tx:attributes>
<tx:method name="storeLhrSendData" propagation="REQUIRES_NEW" />
<tx:method name="storeLhrRecieveData" propagation="REQUIRES_NEW" />
</tx:attributes>
</tx:advice>
<aop:config>
<aopointcut id="storeServiceOperation" expression="execution(* sf.consumerrpt.dataaccess.bo.*.*(..))"/>
<aop:advisor advice-ref="txAdvice01" pointcut-ref="storeServiceOperation"/>
<aop:advisor advice-ref="txAdvice02" pointcut-ref="storeServiceOperation"/>
<aop:advisor advice-ref="txAdvice03" pointcut-ref="storeServiceOperation"/>
<aop:advisor advice-ref="txAdvice04" pointcut-ref="storeServiceOperation"/>
</aop:config>
The methods storeLhrSendData() && storeLhrRecieveData() performs inserts and updates in a table that exists across all 4 databases (using 4 diff jndi's). I get a parameter based on which we deteremine which database to connect.
Since all 4 transaction advices are applied irrespective of the database in use, How are these transactions managed.
For eg:
i used jdbc01 to perform operations on the above methods and we see all 4 advices are applied. Since txAdvice01 is applied it performs the commit or rollback. I want to know Is there any impact/overhead of using txAdvice02/03/04?????
I have seen the code working while connecting different jdbc connections 01/02/03/04 and works since all transactions are applied. I neeed to find out is there any overhead by configuring this way (like too many transactions open)
HELP Needed please in understanding the concept of how it works, before deploying my code in production.![]()


ointcut id="storeServiceOperation" expression="execution(* sf.consumerrpt.dataaccess.bo.*.*(..))"/>
Reply With Quote
