gpt4 book ai didi

Spring : Difference between method with @Transactional(propagation=Propagation. SUPPORTS) vs 没有@Transactional

转载 作者:行者123 更新时间:2023-12-03 22:29:16 26 4
gpt4 key购买 nike

方法与 @Transactional(propagation = Propagation.SUPPORTS) 有什么区别vs 没有 @Transactional注释?

@Transactional(propagation = Propagation.SUPPORTS)
public void MyMethod()

对比
public void MyMethod()

如果一个已经打开,没有注释的人是否也使用事务,否则在没有任何事务的情况下继续?

最佳答案

从您的链接中可以看出 Propagation.SUPPORTS可能会影响
同步:

SUPPORTS is slightly different from no transaction at all, as it defines a transaction scope that synchronization will apply for. As a consequence, the same resources (JDBC Connection, Hibernate Session, etc) will be shared for the entire specified scope

关于Spring : Difference between method with @Transactional(propagation=Propagation. SUPPORTS) vs 没有@Transactional,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58055761/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com