Closed ydinari closed 3 years ago
Never tried that, so I cannot really tell.
Seems a bit conflict to the Transactional
concept, since it must come with typeorm @Transaction
decorator, which opens a transaction and closes it when the method finishes.
I actually think it will not work, since the typeorm @Transaction
creates an entityManager, but does not push it to the cls-hooked context, so therefore it won't be around in the next method.
When working with typeorm Transaction decorator you can inject repositories as parameters to the decorated function using TransactionRepository decorator. Can you use that with the Transactional decorator?