I want to know the potential side effects of chaining @Transactional method calls calling from a private method from the same class. From researching this seems to be a limitation from Spring and can cause side effects but what if the corresponding class calls as separate class that also has the @Transactional Annotation? If B fails, does B rollback and A?
@Service
public class A {
@Autowired
private B myB;
@Transactional
private void transactionA(){
myB.transactionB();
}
public void doTransactionA() {
transactionA();
}
}
@Service
public class B {
@Transactional
private void transactionB(){
//throw an exception
}
}