简体   繁体   English

@Transactional 的默认传播行为

[英]Default propagation beahaviour for @Transactional

I have the following code:我有以下代码:

@Component
public class A{ 

 @Transactional
 public void classa(){
     //logic
 }

}

I don't specify any propagation behaviour for @Transactional annotation.我没有为@Transactional注释指定任何传播行为。 So I want to know what is the default propagation beahaviour for @Transactional in spring?所以我想知道 spring 中@Transactional的默认传播行为是什么?

REQUIRED is the default propagation REQUIRED是默认传播

REQUIRED public static final Propagation REQUIRED Support a current transaction, create a new one if none exists. REQUIRED public static final Propagation REQUIRED 支持当前事务,如果不存在则创建一个新事务。 Analogous to EJB transaction attribute of the same name.类似于同名的 EJB 事务属性。 This is the default setting of a transaction annotation .这是事务注释的默认设置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM