日期:2014-05-17  浏览次数:20711 次

事物不回滚
写了两个insert 方法,定义了所有事务处理方面的公共属性,然后service 继承这个公共的。
我是在Dao 里面调用的,方法1里面调用 方法2的action.insert2
Dao 里面:
 public boolean insert1(){
       Action  a  = new Action();
        a.insert2();
}
异常我就是insert2的sql 里面多写个id ,各位帮忙看看哪里错了
<!-- 定义了所有事务处理方面的公共属性 -->
    <bean id="baseTxProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" abstract="true" lazy-init="true">
        <property name="transactionManager">
            <ref local="transactionManager"/>
        </property>
        <property name="transactionAttributes">
            <props>
                <prop key="update*">PROPAGATION_REQUIRED</prop>
                <prop key="insert*">PROPAGATION_REQUIRED</prop>
                <prop key="delete*">PROPAGATION_REQUIRED</prop>
                <prop key="*">PROPAGATION_REQUIRED</prop>
            </props>
        </property>
    </bean>


<bean id="appo_bs" parent="baseTxProxy">
<property name="target">
<ref local="appo_bs_target"></ref>
</property>
</bean>
Java 事务

------解决方案--------------------

<!-- transaction manager, use JtaTransactionManager for global tx -->
<bean id="txManager"