Spring 事务配置



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

    <tx:advice id="interceptor" transaction-manager="transactionManager">
        <tx:attributes>
            <tx:method name="*"/>
        tx:attributes>
    tx:advice>

    <aop:config>
        <aop:pointcut id="pt" expression="execution(* com.feri.ssm.service.impl.*.*Batch(..))"/>
        <aop:advisor advice-ref="interceptor" pointcut-ref="pt1">aop:advisor>
    aop:config>

        <dependency>
            <groupId>org.springframeworkgroupId>
            <artifactId>spring-jdbcartifactId>
            <version>5.3.25version>
        dependency>

你可能感兴趣的:(Spring,spring,java,spring,boot)