nest_transact icon indicating copy to clipboard operation
nest_transact copied to clipboard

@InjectDataSource() does not work with service.withTransaction()

Open AnsonT opened this issue 2 years ago • 2 comments

After a service is wrapped with TransactionFor<someService>. @InjectDataSource can no longer resolve, giving error:

  "message": "Cannot read properties of undefined (reading 'name')"

AnsonT avatar Dec 11 '22 23:12 AnsonT

I'm having the same issue with NestJS 8.x or 9.x with TypeORM 0.30.x and 8.0.0 or 9.1.0 of nest_transact. Had to revert back to @nestjs/typeorm - 7.1.5 and TypeORM 0.2.45. Fingers crossed this is an easy fix.

woodja avatar Jan 09 '23 21:01 woodja

Hi @AnsonT , @woodja ! Sorry for the long answer; I was in a procrastination loop.

To tell you the truth, I'm swamped right now, and I won't be able to deal with this problem for a few months soon. It would be cool if you could help with that!

alphamikle avatar Jan 12 '23 14:01 alphamikle