我有 3 个 Spring 组件调用 first->second->third。如果我在第一个和第三个上只有 @Transactional 注释,事务是否会正确传播?
@Component public class C1 {
@Autowired C2 c2;
@Transactional public method1() {
...
c2.method2();
}
}
@Component public class C2 {
@Autowired C3 c3;
public method2() {
...
c3.method3();
}
}
@Component public class C3 {
@Transactional public method3() {
...
}
}