Below is structure of my method:
@Override
@Transactional
public methodOuter(){
//some processing
methodInner1();
methodInner2();
}
@Override
@Transactional
public methodInner1(){
//save something to db
}
@Override
@Transactional
public methodInner2(){
//some processing
//throws exception
}
Scenario is methodInner1()
is processed successfully but methodInner2()
throws exception. So i want to rollback commit done in methodInner1()
. Currently commit in methodInner1()
is not getting rolled back. I want methodOuter()
to be in single transaction