Closed niveathika closed 3 years ago
for var count in countArray{
var queryResult = dbClient->query();
if(queryResult is error) {
rollback;
}
}
commit;
The above is not allowed
Need to restrict commiting/rollback within loops
In order to commit/rollback, you have to have it outside the loop. We have restricted the usage from #27418. Furthermore, moving into a transactional code path from a non-transactional code path is also restricted. eg: Here commit is not allowed
transaction {
fooTx();
if something() {
rollback;
// not in transaction mode
bazNonTx();
// not in transaction mode
}
check commit;
}
Description: $subject This becomes an issue when we try to use statements within the loop, we have to wait till loop exit to commit, however, the transaction compiler does not allow that