Spring Boot的事务管理注解@EnableTransactionManagement的使用

论坛 期权论坛 脚本     
匿名技术用户   2021-1-7 21:05   36   0

@EnableTransactionManagement:负责开启springboot 的事物支持,等同于xml配置文件中的 <tx:annotation-driven />

然后在访问数据库的Service方法上添加注解 @Transactional 便可。

在Service中,被 @Transactional 注解的方法,将支持事务。如果注解在类上,则整个类的所有方法都默认支持事务。

转载于:https://www.cnblogs.com/yuxifly828/p/9669783.html

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP