Spring 2.5 配置注解式事务
来源:互联网 发布:东辰国际学校官网通知 编辑:程序博客网 时间:2024/06/05 21:15
applicationContext.xml 配置文件增加以下代码:
1. <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
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
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd">
2. <!--使用注解处理器 -->
<context:annotation-config />
<!--配置事务扫描路径-->
<context:component-scan base-package="gov.service.command.impl" />
<!-- 事务驱动 -->
<tx:annotation-driven transaction-manager="transactionManager" />
3. service 类 在需要加入事务的方法增加@Transactional(propagation=Propagation.REQUIRED)
4. @Transactional(propagation=Propagation.NOT_SUPPORTED) 不支持事务
- Spring 2.5 配置注解式事务
- Spring注解事务配置
- spring 注解事务配置
- spring配置,事务,注解
- Spring注解声明式事务配置
- spring配置声明式事务--注解方式
- Spring配置声明式事务--注解方式
- 深入理解事务--Spring注解式事务配置注意事项
- 深入理解事务--Spring注解式事务配置注意事项
- Spring注解型事务配置
- Spring注解型事务配置
- Spring注解型事务配置
- MyBatis Spring 注解事务配置
- Spring JDBC-使用注解配置声明式事务
- spring 注解事务机制配置和xml事务配置
- Spring 采用注解方式配置事务
- Spring service继承的事务配置(注解)
- spring配置事务之注解方式
- DirectX做2D游戏的三种方法
- 如何使用Box2D和Cocos2D制作一款像Fruit Ninja一样的游戏-第2部分
- unix下取得加密的用户密码
- Android进阶练习-让你的App可定位
- 如何使用Box2D和Cocos2D制作一款像Fruit Ninja一样的游戏-第3部分
- Spring 2.5 配置注解式事务
- python mysql 乱码问题总结
- java JSTL 核心标签库使用
- JAVA 调用Web Service的方法
- 学习JPA——Hibernate Annotation使用实例
- dia 在Linux(ubuntu)下无法输入中文的解决办法
- MFC中Radio Button使用方法
- java中是否存在内存泄露--比较好的回答
- 【SD卡高级清理】使用教程!