With the changes, the transactions are not done per loop anymore, so restart it if we rollback in the loop.