![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SpringBoot
文章平均质量分 74
才_先生
这个作者很懒,什么都没留下…
展开
-
SpringBoot中事件的使用
SpringBoot项目默认是支持事件的,我们只需要自定义事件,然后发布事件,之后监听事件处理业务逻辑即可。SpringBoot中我们会用到事件抽象类ApplicaltionEvent,事件监听接口ApplicationListener,事件发布接口ApplicationEventPublisher或ApplicationContextAware。原创 2022-12-18 17:07:29 · 1322 阅读 · 0 评论 -
SpringBoot事务失效场景和解决办法
Springboot的@Transcational 事务会存在失效场景,要想了解SpringBoot的事务需要先了解一下SpringBoot的事务回滚是对哪些Exception有效的,从源码来看SpringBoot只会对RuntimeException进行回滚,除非指定了回滚类型为Exception,就能对所有的Exception进行回滚。原创 2022-09-12 17:50:22 · 2790 阅读 · 0 评论