ssm事务aop实现(自用)
来源:互联网 发布:线程同步 linux 编辑:程序博客网 时间:2024/05/21 22:25
乱七八糟。。
-- springmvc-servlet.xml
-- sqlite(mysql也行吧没试)
-- 方法内不需要手动和注解方式添加
<!-- 配置数据源事务 -->
<bean id="transactionManager"class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<!-- 开启注解(不需要了)
<tx:annotation-driven transaction-manager="transactionManager" /> -->
<context:component-scan base-package="com.chy.www.*">
<context:exclude-filter type="annotation"
expression="org.springframework.stereotype.Service" />
</context:component-scan>
<!-- aop事务不需要再方法上添加注解 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="get*" propagation="REQUIRED" read-only="true" />
<tx:method name="find*" propagation="REQUIRED" read-only="true" />
<tx:method name="select*" propagation="REQUIRED" read-only="true" />
<!-- <tx:method name="add*" propagation="REQUIRED" isolation="SERIALIZABLE" />
<tx:method name="update*" propagation="REQUIRED" isolation="SERIALIZABLE" />
<tx:method name="delete*" propagation="REQUIRED" isolation="SERIALIZABLE" />
<tx:method name="save*" propagation="REQUIRED" isolation="SERIALIZABLE" /> -->
<tx:method name="*" propagation="REQUIRED" isolation="SERIALIZABLE" />
</tx:attributes>
</tx:advice>
<aop:config proxy-target-class="true">
<aop:pointcut expression="execution(* com.chy.www..*(..))" id="serviceMethod" />
<aop:advisor pointcut-ref="serviceMethod" advice-ref="txAdvice" />
</aop:config>
阅读全文
0 0
- ssm事务aop实现(自用)
- [AOP系列]Autofac+Castle实现AOP事务
- Spring aop实现事务加锁
- 巧用“Delegate”实现AOP事务
- Autofac+Castle实现AOP事务
- 从零实现MVC框架之AOP事务(5)
- 分布式事务JTA实现之:SSM+ATOMIKOS
- 分布式事务JTA实现之:SSM+JOTM
- SSM事务
- Spring Aop实现声明式事务
- spring 手动实现aop管理事务
- C# 用Attribute实现AOP事务
- \t\tC# 用Attribute实现AOP事务
- C# 用Attribute实现AOP事务
- 注解方式实现aop事务切面
- 基于AOP/TX来实现事务操作
- Spring aop实现声明式事务
- spring中事务的aop实现
- 做毕设(六)——登录注册,回复他人评论
- 使用百度API实现实时公交站点查询及地图显示
- 原生Ajax的使用
- 关于ffmpeg 的命令总结
- 一些小笔记
- ssm事务aop实现(自用)
- java:实现字符串到二进制字符、16进制字符、unicode字符、base64字符之间的转换
- px dp 转换
- TLS/SSL 协议详解 (20)加密套件的选择
- 二类分类问题评价指标
- 《高性能SQL调优精要与案例解析》样章
- servlet类的实现
- SMTP协议发送邮件和附件
- ffmpeg 几条命令