Spring事务配置
2016-05-31 00:00
423 查看
摘要: spring和mybatis事务配置
<bean name="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"></property>
</bean>
遇到的异常
execution括号中第一个*号后需加空格,不加空格会报错
Caused by: java.lang.IllegalArgumentException: Pointcut is not well-formed:
<bean name="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"></property>
</bean>
<tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="insert*" propagation="REQUIRED"/> <tx:method name="update*" propagation="REQUIRED"/> <tx:method name="delete*" propagation="REQUIRED"/> <tx:method name="select*" propagation="REQUIRED"/> </tx:attributes> </tx:advice> <aop:config > <aop:pointcut id="allserviceMethod" expression="execution(* com.hrm.service.*.*(..))"/> <aop:advisor advice-ref="txAdvice" pointcut-ref="allserviceMethod"/> </aop:config>
遇到的异常
execution括号中第一个*号后需加空格,不加空格会报错
Caused by: java.lang.IllegalArgumentException: Pointcut is not well-formed:
相关文章推荐
- Java线程(二):线程同步synchronized和volatile
- 枚举
- 泛型
- springmvc的上传功能
- Java Connection.setAutoCommit使用的注意事项
- Java中文件、文件目录的删除操作
- MyEclipse 启动报错:'Building workspace' has encountere
- MyEclipse修改jsp模板文件
- 如何优化myEclipse 启动速度
- Java ConcurrentModificationException 异常分析与解决方案
- 好习惯:Java内存管理
- Java线程(一):线程安全与不安全
- Spring-事务处理
- [原创]java WEB学习笔记29:Cookie Demo 之自动登录
- Java编程思想第四版第十章学习——内部类(1)
- 华为机试---蛇形矩阵
- JavaMail技术
- Java NIO使用及原理分析
- eclipse提交项目到github
- java之io之File类的list()方法过滤目录的使用