配置系列:(事物管理)ssm中applicationContext-transaction.xml的简单配置
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd">
<!-- 定义事务管理器 -->
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<!-- 定义事务策略 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<!--所有以query开头的方法都是只读的 -->
<tx:method name="query*" read-only="true" />
<!--其他方法使用默认事务策略 -->
<tx:method name="*" />
</tx:attributes>
</tx:advice>
<aop:config>
<!--pointcut元素定义一个切入点,execution中的第一个星号 用以匹配方法的返回类型,
这里星号表明匹配所有返回类型。 com.simple.sso.service.*.*(..)表明匹配com.simple.sso.service包下的所有类的所有
方法 -->
<aop:pointcut id="myPointcut" expression="execution(* com.simple.sso.service.*.*(..))" />
<!--将定义好的事务处理策略应用到上述的切入点 -->
<aop:advisor advice-ref="txAdvice" pointcut-ref="myPointcut" />
</aop:config>
</beans>
转载于:https://blog.51cto.com/simplelife/1695781
配置系列:(事物管理)ssm中applicationContext-transaction.xml的简单配置相关推荐
- 大型企业网络配置系列课程详解(四) --HSRP和VRRP配置与相关概念的理解(一)...
大型企业网络配置系列课程详解(四)<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office&qu ...
- 大型企业网络配置系列课程详解(六) --PPP链路的配置与相关概念的理解
大型企业网络配置系列课程详解(六)<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office&qu ...
- 【转】淮左白衣-解决maven管理SSM中mybatis的mapper文件扫描失败的问题
本文链接: https://blog.csdn.net/youngyouth/article/details/86468910 好久没有写博客了,11月底来到公司实习,上个月写个小demo,趁此回顾下 ...
- Spring中ApplicationContext加载机制和配置初始化
转自:http://liuwei1578.blog.163.com/blog/static/495803642007116111923195/ Spring中ApplicationContext加载机 ...
- linux集群中mpi的并行计算环境简单配置,linux集群中MPI的并行计算环境简单配置(转)...
一.集群和Linux上的集群解决方案 集群计算机是指用一组联网的PC或工作站来搭建成的,提供比单个PC(节点)计算性能高得多的计算机.说其是计算机,其实是针对所提供出来的服务而言的,或者说是逻辑上来说 ...
- access下如何配置两个vlan_不同vlan间的通信如何简单配置(三种方式) ?
1.单臂路由(图) 环境:一台路由器,一台二层交换机,两台pc机 二层交换机的配置 一般模式: Switch> 输入enable进入特权模式: Switch>enable 输入config ...
- 快捷配置mysql_windows下的mysql的快捷安装方法和简单配置
windows下的mysql的快捷安装方法和简单配置 作者:兴邦开发部 人气: 发表时间:2015年12月14日 [文章内容简介]:关于windows下的mysql的安装有很多种形式,下面来介绍一种简 ...
- oracle xe 安装配置,(转)oracle 10g xe 我的安装实践及简单配置过程
(转)oracle 10g xe 我的安装实践及简单配置过程 我的安装过程 1.编辑 /etc/apt/sources.list : sudo cp /etc/apt/sources.list /et ...
- linux集群中mpi的并行计算环境简单配置,linux集群中MPI的并行计算环境简单配置...
MPI有多种实现版本,如MPICH, CHIMP以及OPENMPI.其中MPICH是一种最重要的MPI实现,它可以从网上免费获得Linux和Windows版本.它的开发和MPI规范的制定是同步的,因此 ...
最新文章
- 一款蓝牙音频无线传输设备上拆下的光电管
- 四、MySql七个查询命令中哪些命令执行效率过慢
- CLR 4.0 有哪些新东西? -- 类型等价
- [leetcode] Restore IP Addresses
- 主产品清单位于oracle,OPatch failed with error code 73(OracleHomeInventory gets null oracleHomeInfo)...
- Blazor带我重玩前端(二)
- 论文浅尝 | 一个模型解决所有问题:实体和事件的神经联合模型
- RTP封装G711源代码
- 苹果赢了!iOS14隐私功能并不违反法国反垄断法
- javaweb超市仓库管理系统
- 方法重写和方法重载的区别
- 二进制漏洞挖掘之angr‘s Reaching Definition Analysis(二)
- 代码审计| HDWiki 漏洞(一)
- vs2010生成的exe更改icon
- 统计学习方法 - 绪论部分
- Halcon圆查找功能简介
- MongoDB 全面总结
- 中国移动MIFI--CM510,4G TD-LTE MIFI 上网终端开箱及初步体验@上海
- yolov1-v3学习报告
- 来看看国外DBA的工资