码迷,mamicode.com
首页 > 编程语言 > 详细

springboot的問題

时间:2017-05-10 13:11:06      阅读:129      评论:0      收藏:0      [点我收藏+]

标签:注入   jar包   data-   nbsp   ota   class   can   gem   cti   

一、事务

PlatformTransactionManager 如果你添加的是 spring-boot-starter-jdbc jar包,框架会默认注入 DataSourceTransactionManager 实例。如果你添加的是 spring-boot-starter-data-jpa  jar包,框架会默认注入 JpaTransactionManager 实例。

@EnableTransactionManagement
@SpringBootApplication
@ComponentScan
public class signRestApplication extends SpringBootServletInitializer{}

 

@EnableTransactionManagement (等同于xml配置文件中的 <tx:annotation-driven />)

运行signRestApplication 时启动事务管理,在service上加上@Transactional实现事务管理

springboot的問題

标签:注入   jar包   data-   nbsp   ota   class   can   gem   cti   

原文地址:http://www.cnblogs.com/mqy1/p/6835053.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!