I have several operations (service calls,but I guess that's not important) I need to run atomically. Let's say I got operations A, B and C which read and write DB multiple times and I need:
I'm thinking @Transactional (like in example below) is exactly what I need here (with correctly configured isolation etc.), but I'm not sure. Can I use @Transactional to solve this? If yes, how to configure it correctly? Thanks.
@Transactional(...)
public void someTransactionalMethod(...) {
callA();
callB();
callC();
}
P.S.: you may suggest that I try to design things a bit differently (better), but I'm afraid that's beyond the realm of possibility. I am bound by existing code etc. (for example inner workings of most of those operations are not under my control).
Apparently @Transactional is exactly what I need here. Thanks @cool