zoukankan      html  css  js  c++  java
  • 我将Spring配置文件放置在applicationContextcommon.xml中

    我将Spring配置文件放置在applicationContext-common.xml中

    Xml代码  收藏代码
    1. <?xml version="1.0" encoding="UTF-8"?>  
    2.   
    3. <beans xmlns="http://www.springframework.org/schema/beans"  
    4.          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
    5.          xmlns:aop="http://www.springframework.org/schema/aop"  
    6.          xmlns:tx="http://www.springframework.org/schema/tx"  
    7.          xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd  
    8.            http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd  
    9.            http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">  
    10.       
    11.        <!-- 配置sessionFactory -->  
    12.     <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">  
    13.         <property name="configLocation">  
    14.             <value>classpath:hibernate.cfg.xml</value>  
    15.         </property>  
    16.     </bean>     
    17.       
    18.     <!-- 配置事务管理器 -->    
    19.     <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">  
    20.         <property name="sessionFactory">  
    21.             <ref local="sessionFactory"/>  
    22.         </property>  
    23.     </bean>  
    24.       
    25.     <!-- 配置事务特性 -->         
    26.     <tx:advice id="txAdvice" transaction-manager="transactionManager">  
    27.         <tx:attributes>  
    28.             <tx:method name="*" propagation="REQUIRED"/>  
    29.               <!--  
    30.                <tx:method name="add*" propagation="REQUIRED"/>                
    31.             <tx:method name="del*" propagation="REQUIRED"/>  
    32.             <tx:method name="update*" propagation="REQUIRED"/>  
    33.             <tx:method name="deploy*" propagation="REQUIRED"/>  
    34.             <tx:method name="submit*" propagation="REQUIRED"/>  
    35.             <tx:method name="*" read-only="true"/>  
    36.             -->  
    37.         </tx:attributes>  
    38.     </tx:advice>  
    39.       
    40.     <!-- 配置那些类的方法进行事务管理 -->  
    41.     <aop:config>  
    42.         <aop:pointcut id="allManagerMethod" expression="execution (* com.gdf.crm.manager.*.*(..))"/>  
    43.         <aop:advisor advice-ref="txAdvice" pointcut-ref="allManagerMethod"/>  
    44.     </aop:config>      
    45.         
    46. </beans>  
    你给了我眼睛,却不给我光明。
  • 相关阅读:
    滴滴Ceph分布式存储系统优化之锁优化
    滴滴数据仓库指标体系建设实践
    滴滴AI Labs斩获国际机器翻译大赛中译英方向世界第三
    滴滴数据通道服务演进之路
    可编程网卡芯片在滴滴云网络的应用实践
    GPU虚拟机创建时间深度优化
    滴滴ElasticSearch千万级TPS写入性能翻倍技术剖析
    使用zip()并行迭代
    循环结构
    选择结构
  • 原文地址:https://www.cnblogs.com/wwb0111/p/3098943.html
Copyright © 2011-2022 走看看