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

导致spring事务配置不起作用的一种原因

时间:2017-05-07 00:12:19      阅读:247      评论:0      收藏:0      [点我收藏+]

标签:sap   actions   component   bsp   sys   style   ini   ica   div   

@Component
public class AnalyticsApplication {

    @Autowired
    private InitializationActionService initializationActionService;

    @PostConstruct
    @Transactional("transactionManager") // in here, the transaction configuration does not work
    public void systemInitialize() {
        initializationActionService.systemInitialize();
    }

}

-----------------------------------------------------------------------------

@Component
public class InitializationActionService {

    public void systemInitialize() {
          // TODO: do something
    }

}

 

 

 

@Component
public class AnalyticsApplication {

    @Autowired
    private InitializationActionService initializationActionService;

    @PostConstruct
    public void systemInitialize() {
        initializationActionService.systemInitialize();
    }

}

-----------------------------------------------------------------------------

@Component
public class InitializationActionService {

    @Transactional("transactionManager") // in here, The transaction configuration works
    public void systemInitialize() {
          // TODO: do something
    }

}

 

导致spring事务配置不起作用的一种原因

标签:sap   actions   component   bsp   sys   style   ini   ica   div   

原文地址:http://www.cnblogs.com/bgo-tech/p/6819128.html

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