Closed blackout1208 closed 6 years ago
I'd check for race conditions, the rollback may be getting called before any changes are made. That's the only thing that comes to mind at the moment.
The issue here is that forEach
does not support async functions and thus does not wait for them to resolve. The function doesn’t get suspended, so the transaction is rolled back instantly after forEach
ran, but before the inner functions complete.
Yep, that's completely it. I'd use Bluebird's Promise.each: http://bluebirdjs.com/docs/api/promise.each.html
Can anyone explain me why this transaction is not rolling back?
Meanwhile, if I use in this method works fine: