I have this kind of code:
@Service
public class AService {
public void methodA() {
try {
methodB();
} catch (Exception e) {
methodC(e);
}
}
}
methodB is reading from DB. methodC is writing the Exception if occurred to the DB. for some reason, when method B throws an error, the writing in methodC is not working and I get - UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only.
would appreciate any advice on this, thanks!