class MyService {
public void a() {
synchronized(somekey) {
b();
}
}
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void b() {
...do DB works...
}
}
My aim is
- 1 - get the key
- 2 - start transaction
- 3 - commit transaction
- 4 - release the key
When i call a() method from outside, transaction doesn't work.
Any suggestions ?
Thanks.