Open mdevecka opened 2 months ago
I think it's already committed in the transaction that makes user3, user4
The reason is that if the propagation property is set toNESTED
, new transactions that are unrelated to the parent transaction are opened and executed
I think the propagation property should be REQUIRED
to throw an error at the abort3 position and don't create user3, user4
I was looking for a propagation type with implementation that would not commit nested transactions if parent transaction is aborted. I found some workaround around this in the meantime. Also from your source code there does not seem to be a difference between NESTED and REQUIRES_NEW: https://github.com/Aliheym/typeorm-transactional/blob/master/src/transactions/wrap-in-transaction.ts#L92
original:
with typeorm-transactional:
When using typeorm-transactional test case abort3 does create user3 and user4 which is not desired. (other cases work as expected)