Spring声明式事务配置——AOP方式
来源:互联网 发布:xp网络共享打印机设置 编辑:程序博客网 时间:2024/05/17 04:52
<?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:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> <context:annotation-config /> <context:component-scan base-package="com.bluesky" /> <!-- 第一步:配置sessionFactory或者dataSource,这里是配置的sessionFactory--> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="configLocation" value="classpath:hibernate.cfg.xml" /> <property name="configurationClass" value="org.hibernate.cfg.AnnotationConfiguration" /> </bean> <!-- 第二步:定义事务管理器(声明式的事务) --> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean><!-- 第三步:配置事务方法传播特性 --> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="save*" propagation="REQUIRED" /> <tx:method name="add*" propagation="REQUIRED" /> <tx:method name="del*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> <tx:method name="batch*" propagation="REQUIRED" /> <tx:method name="complete*" propagation="REQUIRED" /> <tx:method name="*" read-only="false" /> </tx:attributes> </tx:advice><!-- 第四步:配置事务aop切面 --> <aop:config> <aop:pointcut id="interceptorPointCuts" expression="execution(* com.bluesky.spring.dao.*.*(..))" /> <aop:advisor advice-ref="txAdvice" pointcut-ref="interceptorPointCuts" /> </aop:config></bean>
0 0
- Spring声明式事务配置——AOP方式
- spring配置声明式事务--注解方式
- Spring配置声明式事务--注解方式
- Spring声明式事务的配置方式
- Spring声明式事务(AOP的tx方式)
- 使用Spring的声明式事务----AOP方式
- 使用Spring的声明式事务----AOP方式
- 使用Spring AOP 自动代理配置声明式事务
- 使用Spring AOP 自动代理配置声明式事务
- Spring基于tx/aop声明式事务配置
- spring声明式事务配置方法 aop:config切入
- Spring基于tx/aop声明式事务配置
- Spring Aop实现声明式事务
- spring声明式事务【使用AOP】
- Spring aop实现声明式事务
- Spring 声明式事务的配置方式(一)
- Spring 声明式事务的配置方式(二)
- Spring 声明式事务的配置方式(三)
- 一个最简单的cocos2dx-lua 演示说明
- android技术篇(一)解锁bootloader
- 使用Fetch
- 虚拟设备创建多分区虚拟磁盘(软盘,硬盘)
- flume收集日志到mysql
- Spring声明式事务配置——AOP方式
- win32编程隐藏窗口
- 高质量C++编程-命名风格
- Android 实现单击View,中间出现水波纹效果,在执行点击事件。
- Seek and Destroy(算法)
- 455. Assign Cookies -- 贪心算法
- Linux下如何查看分区文件系统类型
- Gradle 错误
- 创建窗口第三步 消息循环(详解)