摘要: beans.xml:<?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="ht 阅读全文
posted @ 2012-08-12 20:05 xzf007 阅读(146) 评论(0) 推荐(0) 编辑
摘要: spring对于事务异常的处理//unchecked 运行期Exception spring默认会进行事务回滚 比如:RuntimeException//checked 用户Exception spring默认不会进行事务回滚 比如:Exception如何改变spring的这种默认事务行为?可以通过在方法上添加@Transactional(noRollbackFor=RuntimeException.class)让spring对于RuntimeException不回滚事务添加@Transactional(RollbackFor=Exception.class)让spring对于Exceptio 阅读全文
posted @ 2012-08-12 16:57 xzf007 阅读(802) 评论(0) 推荐(0) 编辑
摘要: ************************beans.xml************************<?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.springframe 阅读全文
posted @ 2012-08-12 16:27 xzf007 阅读(142) 评论(0) 推荐(0) 编辑