javaWeb
Phenix_ljy
这个作者很懒,什么都没留下…
展开
-
Spring定时任务@Scheduled注解使用
一、配置spring.xml配置文件1、在xmlns加入: xmlns:task="http://www.springframework.org/schema/task"2、在xsi:schemaLocation中加入: http://www.springframework.org/schema/task http://www.springframework.org...原创 2018-03-01 16:42:17 · 2243 阅读 · 0 评论 -
Spring事务管理之回滚异常rollback-for
一、业务背景业务需求:服务层调用多个dao方法,要求只要有一条数据库执行语句出错,则全部回滚。而实际情况是前面四条执行成功,第五条失败,结果只是抛出异常提示,前面四条还是成功执行。二、出错原因异常分为checked Exception 捕获异常 跟 unchecked Exception 未捕获异常,Spring默认发生未捕获异常时自动回滚,如发生RuntimeException。项目中都有针对调...原创 2018-06-27 14:17:26 · 7369 阅读 · 0 评论