I wonder, what happens when @Transactional(readonly=true) method calls @Transactional(readonly=false) method? Talking about the situation with propagation = Propagation.REQUIRED (within the outer transaction scope).
public class ServiceA {
ServiceB serviceB;
@Transactional(readonly = true)
public void readOnly() {
// some reading from repo
serviceB.write()
}
}
public class ServiceB {
@Transactional
public void write() {
// some write to repo
}
}
The same question for the opposite situation, what happens if @Transactional(readonly=false) method calls @Transactional(readonly=true) method? I suppose that for the last case it would just consider @Transactional(readonly=false) from the outer scope.