如何将对mysql的操作与对oracle的操作封装在一个事务中?

分布式事务的处理:

<bean id="dataSourceMysql"
   class="com.atomikos.jdbc.AtomikosDataSourceBean" init-method="init"
   destroy-method="close">
   <property name="uniqueResourceName"
    value="${mysql.uniqueResourceName}" />
   <property name="xaDataSourceClassName"
    value="${mysql.xaDataSourceClassName}" />
   <property name="xaProperties">
    <props>
     <prop key="user">${mysql.user}</prop>
     <prop key="password">${mysql.password}</prop>
     <prop key="URL">${mysql.url}</prop>
    </props>
   </property>
   <property name="poolSize" value="${mysql.poolSize}" />
</bean>
<bean id="dataSourceOracle"
   class="com.atomikos.jdbc.AtomikosDataSourceBean" init-method="init"
   destroy-method="close">
   <property name="uniqueResourceName"
    value="${oracle.uniqueResourceName}" />
   <property name="xaDataSourceClassName"
    value="${oracle.xaDataSourceClassName}" />
   <property name="xaProperties">
    <props>
     <prop key="user">${oracle.user}</prop>
     <prop key="password">${oracle.password}</prop>
     <prop key="URL">${oracle.url}</prop>
    </props>
   </property>
   <property name="poolSize" value="${oracle.poolSize}" />
</bean>

 

项目代码请到csdn下载:

http://download.csdn.net/source/1912069

你可能感兴趣的:(oracle,mysql,bean,.net,jdbc)