春季交易效果比单交易高

时间:2019-07-02 11:00:11

标签: mysql spring hibernate transactions

因此,我很想知道如果我们在一个流程中有一个包含多个更新的单个事务,或者每个更新都有单独的事务,那么会对性能产生什么影响。

如果应用程序可以同时支持这两种模式,那么最好选择一种。但是,如果应用程序只能采用第二种选择,那就是对所有更新进行不同的事务处理,那么就性能而言,我们可以获得多少回报。

@Transactional 
public updateXYZ(){
 updateX()
 updateY()
 updateZ()
}

VS

public updateXYZ(){
 updateSeprateTransactionX()
 updateSeprateTransactionY()
 updateSeprateTransactionZ()
}

0 个答案:

没有答案
相关问题