zoukankan      html  css  js  c++  java
  • ssh事务配置

    <!-- 配置业务层 -->
        <bean id="employeeService" class="cn.bdqn.jboa.service.impl.EmployeeServiceImpl">
            <property name="employeeDao" ref="employeeDao"></property>
        </bean>
        <bean id="claimVoucherService" class="cn.bdqn.jboa.service.impl.ClaimVoucherServiceImpl">
            <property name="claimVoucherDao" ref="claimVoucherDao" />
            <property name="claimVoucherDetailDao" ref="claimVoucherDetailDao" />
        </bean>
        
        <!-- 定义事务管理器 -->
        <bean id="txManager"
            class="org.springframework.orm.hibernate3.HibernateTransactionManager">
            <property name="sessionFactory" ref="sessionFactory" />
        </bean>
        <tx:advice id="txAdvice" transaction-manager="txManager">
            <tx:attributes>
                <tx:method name="find*" read-only="true" />
                <tx:method name="search*" read-only="true" />
                <tx:method name="query*" read-only="true" />
                <tx:method name="add*" propagation="REQUIRED" />
                <tx:method name="del*" propagation="REQUIRED" />
                <tx:method name="update*" propagation="REQUIRED" />
                <tx:method name="do*" propagation="REQUIRED" />
                <tx:method name="*" propagation="REQUIRED" read-only="true" />
            </tx:attributes>
        </tx:advice>
        <aop:config>
            <!-- 定义切入点 -->
            <aop:pointcut id="serviceMethod"
                expression="execution(* cn.bdqn.jboa.service.*.*(..))" />
            <!-- 将事务通知与切入点组合 -->
            <aop:advisor advice-ref="txAdvice" pointcut-ref="serviceMethod" />
        </aop:config>
  • 相关阅读:
    前置机器学习(一):数学符号及希腊字母
    大神造轮子与小白调包侠#0509
    Windows下的apache maven安装与配置
    Windows下的apache tomcat安装与配置
    C++ <Algorithm>小小总结
    Markdown 小记
    http状态码
    vim命令
    C++ inline
    爬虫前提——正则表达式语法以及在Python中的使用
  • 原文地址:https://www.cnblogs.com/xuerong/p/4935013.html
Copyright © 2011-2022 走看看