摘要:
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 阅读全文
摘要:
spring对于事务异常的处理//unchecked 运行期Exception spring默认会进行事务回滚 比如:RuntimeException//checked 用户Exception spring默认不会进行事务回滚 比如:Exception如何改变spring的这种默认事务行为?可以通过在方法上添加@Transactional(noRollbackFor=RuntimeException.class)让spring对于RuntimeException不回滚事务添加@Transactional(RollbackFor=Exception.class)让spring对于Exceptio 阅读全文
摘要:
************************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 阅读全文