mybatis-spring声明式事务的配置

<bean id="transcationManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSourse"/>
    </bean>
    <tx:advice id="txadvice" transaction-manager="transcationManager">
        <tx:attributes>
            <tx:method name="*" propagation="REQUIRED"/>
        </tx:attributes>
    </tx:advice>
    <!--aop织入-->
    <aop:config>
        <aop:pointcut id="txPointCut" expression="execution(* com.shida.Mapper.*.*(..))"/>
        <aop:advisor advice-ref="txadvice" pointcut-ref="txPointCut"/>
    </aop:config>
posted @ 2020-11-20 05:09  Meeseeks  阅读(99)  评论(0)    收藏  举报