My method calls are like follow.
@TransactionAttribute(TransactionAttributeType.SUPPORTS
void M1() {
M2();
M3();
}
@TransactionAttribute(TransactionAttributeType.REQUIRED)
void M2(){
//saving x on data base
}
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
void M3(){
//accessing x from data base
}
The issue is, some times value x is unavailable at method M3.
Can any body say whats the possible issue here ?
There are two cases in your example, result is depending on whether is transaction already started in
M1
or not, let me show you how it worksI hope it's helpful for you, solution would be marking
M1
REQUIRED as well.