事务配置

    xiaoxiao2021-03-25  18

    事务配置

    <!-- 事务 --> <bean id="atpTradeTransactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="atp-base-seashell-SessionFactory" /> </bean> <!-- 以InTx、InIsolatedTx结尾的方法加事务 --> <aop:config> <aop:advisor pointcut="execution(* com.bill99.seashell.domain.service.insure..*Service.*(..))" advice-ref="txAdvice" order="1" /> <aop:advisor pointcut="execution(* com.bill99.fpd.atp.handle.*Handler.*(..))" advice-ref="retireAdvice" order="2" /> </aop:config> <tx:advice id="txAdvice" transaction-manager="atpTradeTransactionManager"> <tx:attributes> <tx:method name="save*" propagation="REQUIRED" rollback-for="java.lang.Exception" /> <tx:method name="update*" propagation="REQUIRED" rollback-for="java.lang.Exception" /> <tx:method name="batchUpdate*" propagation="REQUIRED" rollback-for="java.lang.Exception" /> <tx:method name="*Tx" propagation="REQUIRED" rollback-for="java.lang.Exception" /> <tx:method name="*InIsolatedTx" propagation="REQUIRES_NEW" /> <tx:method name="forUpdate*" propagation="REQUIRED" rollback-for="java.lang.Exception" /> <tx:method name="*" propagation="SUPPORTS" /> </tx:attributes> </tx:advice> <tx:advice id="retireAdvice" transaction-manager="atpTradeTransactionManager"> <tx:attributes> <tx:method name="handleRetireInsure" propagation="REQUIRED" rollback-for="java.lang.Exception" /> </tx:attributes> </tx:advice>

    --------------------------------分割符

    <!-- 事务 --> <bean id="atpInterestTransactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="atp-funds-base-seashell-SessionFactory" /> </bean> <!-- 以InTx、InIsolatedTx结尾的方法加事务 --> <aop:config> <aop:advisor pointcut="execution(* com.bill99.seashell.domain.service.atp..*Service.*(..))" advice-ref="txAdvice" order="1" /> </aop:config> <tx:advice id="txAdvice" transaction-manager="atpInterestTransactionManager"> <tx:attributes> <tx:method name="save*" propagation="REQUIRED" rollback-for="java.lang.Exception" /> <tx:method name="update*" propagation="REQUIRED" rollback-for="java.lang.Exception" /> <tx:method name="batchUpdate*" propagation="REQUIRED" rollback-for="java.lang.Exception" /> <tx:method name="batchSave*" propagation="REQUIRED" rollback-for="java.lang.Exception" /> <tx:method name="*Tx" propagation="REQUIRED" rollback-for="java.lang.Exception" /> <tx:method name="*InIsolatedTx" propagation="REQUIRES_NEW" /> <tx:method name="*" propagation="SUPPORTS" /> </tx:attributes> </tx:advice>

    转载请注明原文地址: https://ju.6miu.com/read-50174.html

    最新回复(0)