<bean destroy-method="close">
<property ref="dataSource1"/>
<property value="dataSource1"/>
<property value="com.alibaba.druid.pool.xa.DruidXADataSource"/>
<property>
<props>
<prop key="serverName">test</prop>
<prop key="portNumber">test</prop>
<prop key="databaseName">test</prop>
<prop key="user">test</prop>
<prop key="password">test</prop>
</props>
</property>
</bean>
dataSource2
<bean destroy-method="close">
<property ref="dataSource2"/>
<property value="dataSource2"/>
<property value="com.alibaba.druid.pool.xa.DruidXADataSource"/>
<property>
<props>
<prop key="serverName">test</prop>
<prop key="portNumber">test</prop>
<prop key="databaseName">test</prop>
<prop key="user">test</prop>
<prop key="password">test</prop>
</props>
</property>
</bean>
3、将数据源托管到TranscationManager
<beanhttps://www.linuxidc.com/topicnews.aspx?tid=3" target="_blank" title="SUSE">SUSErTransaction"
>
<description>UserTransactionImp</description>
<property value="300"/>
</bean>
<bean
init-method="init" destroy-method="close">
<description>UserTransactionManager</description>
<property>
<value>true</value>
</property>
</bean>
<bean>
<description>JtaTransactionManager</description>
<property>
<ref bean="atomikosTransactionManager" />
</property>
<property>
<ref bean="atomikosUserTransaction" />
</property>
<property value="true"/>
</bean>
4、定义切面