Untitled

mail@pastecode.io avatar
unknown
java
2 years ago
452 B
1
Indexable
Never
@Service
class A {
    @Autowired
    private B b;
    //
    @Transactional
    public void doA() {
        // some work with BD A
        try {
            b.doB();
        } catch (Exception ex) {
            // just log
        }
    }
}

@Service
class B {
    @Transactional
    public void doB() {
        // some work with DB
        if (true) { // some operation with exception
            throw new IllegalStateException();
        } 
    }
}