摘要: 什么是全局事务: Spring Boot(Spring) 事务是通过 aop(aop相关术语:通知(Advice)、连接点(Joinpoint)、切入点(Pointcut)、切面(Aspect)、目标(Target)、代理(Proxy)、织入(Weaving)) 切面编程来实现的,此时我们就可以对指 阅读全文
posted @ 2019-11-11 15:34 coding++ 阅读(634) 评论(1) 推荐(0)
摘要: Spring 事务的入口: TxAdviceBeanDefinitionParser 解释 <tx:advice/> 这里将解析tx的配置。 @Override protected Class<?> getBeanClass(Element element) { return Transaction 阅读全文
posted @ 2019-11-11 15:19 coding++ 阅读(517) 评论(0) 推荐(0)
摘要: 异常: 如下图所示,我们都知道 Exception 分为 运行时异常 RuntimeException 和 非运行时异常。 error 是一定会回滚的。 如果不对运行时异常进行处理,那么出现运行时异常之后,要么是线程中止,要么是主程序终止。 如果不想终止,则必须捕获所有的运行时异常,决不让这个处理线 阅读全文
posted @ 2019-11-11 14:08 coding++ 阅读(149) 评论(0) 推荐(0)
摘要: @Transactional spring 事务注解 1、简单开启事务管理 @EnableTransactionManagement // 启注解事务管理,等同于xml配置方式的 <tx:annotation-driven /> 2、事务注解详解 默认遇到:throw new RuntimeExce 阅读全文
posted @ 2019-11-11 11:39 coding++ 阅读(226) 评论(0) 推荐(0)