Untitled

 avatar
unknown
java
3 years ago
452 B
3
Indexable
@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();
        } 
    }
}
Editor is loading...