2015-11-07 165 views
2
@Transactional 
public class someClass implements someInterface { 

    @override 
    public void insertData() {  
     updateOtherTable(); 
    } 

    private updateOtherTable() { 
     //will this use above transaction or will not use any transaction? 
    } 
} 

回答

3

Spring代理公用insertData方法,因此該方法中的所有內容都在事務中執行。所以是的交易也適用於你的私人方法。

相關問題