zoukankan      html  css  js  c++  java
  • service层springservice.xml文件

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context.xsd
    http://www.springframework.org/schema/tx
    http://www.springframework.org/schema/tx/spring-tx.xsd
    http://www.springframework.org/schema/aop
    http://www.springframework.org/schema/aop/spring-aop.xsd">

    <!--开启注解扫描-->
    <context:component-scan base-package="cn.gxkj.service"/>

    <!--引入dao数据源配置文件-->
    <import resource="classpath:spring/springdao.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="find*" read-only="true" propagation="SUPPORTS"/>
    <tx:method name="add" propagation="REQUIRED" rollback-for="Exception"/>
    <tx:method name="upd" propagation="REQUIRED" rollback-for="Exception"/>
    <tx:method name="search*" read-only="true" propagation="SUPPORTS"/>
    <tx:method name="get*" read-only="true" propagation="SUPPORTS"/>
    <tx:method name="*" read-only="false" propagation="REQUIRED" rollback-for="Exception"/>
    </tx:attributes>
    </tx:advice>
    <!--切面配置-->
    <aop:config>
    <aop:advisor advice-ref="txAdvice" pointcut="execution(* cn.gxkj.service.impl.*.*(..))"/>
    </aop:config>

    </beans>
  • 相关阅读:
    SogouCloud.exe进程导致SQL Server服务无法启动
    SQL Server 锁实验(INSERT加锁探究)
    php如何处理大数据高并发
    PHP变量的初始化以及赋值方式介绍
    PHP数组具有的特性有哪些
    PHP中Session ID的实现原理分析
    PHP提高SESSION响应速度的方法有哪些
    PHP中Redis扩展无法加载问题
    关于PHP中依赖注入的详细介绍
    PHP中接口与抽象类的异同点有哪些
  • 原文地址:https://www.cnblogs.com/dingyi-boss/p/11480005.html
Copyright © 2011-2022 走看看