关闭事务时,Oracle DB Link 不更新数据库

On closing transaction, Oracle DB Link doesn't update the database

我在数据库"A"下有一些插入操作。接下来,我对数据库 "A" 进行操作,该操作使用 Oracle DB Link 与数据库 "B" 连接以更新到第二个数据库。当方法执行完成时,所有对数据库 "A" 的操作都被持久化,但是对数据库 "B" 的操作不存在。

我正在使用 Spring 3.2.3.RELEASE 和 MyBatis 3.2.3

我的applicationContext.xml:

<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <property name="dataSource" ref="dataSource" />
</bean>

<tx:advice id="txAdvice" transaction-manager="transactionManager">
    <tx:attributes>
        <tx:method name="get*" read-only="true" />
        <tx:method name="*" />
    </tx:attributes>
</tx:advice>

<aop:config proxy-target-class="false">
    <aop:pointcut id="businessEbOperation" expression="bean(*BO)" />
    <aop:advisor advice-ref="txAdvice" pointcut-ref="businessEbOperation" />
</aop:config>

<!-- define the SqlSessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
    <property name="dataSource" ref="dataSource" />
    <property name="typeAliasesPackage" value="com.foo.core.entities" />
    <property name="configLocation" value="classpath:mybatis-config.xml" />
</bean>

<!-- Oracle 10g DataSource -->
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName">
        <value>java:/OracleDS</value>
    </property>
</bean>

提前致谢!

一开始以为是数据库配置的问题,后来在MyBatis中修改查询时,检测到标签select,而不是标签update:

<update id="cancelPackage" statementType="CALLABLE">
    {call pa_packages.cancel_cellular_packages(
    #{PKT_ID, mode=IN, jdbcType=VARCHAR}
    , #{CAN_DATE, mode=IN, jdbcType=DATE, javaType=java.util.Date}
    , #{CELLULAR, mode=IN, jdbcType=VARCHAR}
    ...)}
</update>

总而言之,DB 链接的使用是透明的,由数据库处理。当函数结束时,所有的修改都被提交。