@EnableTransactionManagement表示开启事务支持,在springboot项目中一般配置在启动类上,效果等同于xml配置的<tx:annotation-driven />。开启事务支持后,然后在访问数据库的Service方法上添加注解 @Transactional 便可。
转载于:https://www.cnblogs.com/shamo89/p/7850121.html
@EnableTransactionManagement表示开启事务支持,在springboot项目中一般配置在启动类上,效果等同于xml配置的<tx:annotation-driven />。开启事务支持后,然后在访问数据库的Service方法上添加注解 @Transactional 便可。
转载于:https://www.cnblogs.com/shamo89/p/7850121.html