typeorm-transactional-cls-hooked icon indicating copy to clipboard operation
typeorm-transactional-cls-hooked copied to clipboard

How do i get Transaction to work ? Getting ConnectionNotFound error

Open Caesarsage opened this issue 2 years ago • 5 comments

I added the @Transactional() decorator to my service and this is the error it throws

ConnectionNotFoundError: Connection "default" was not found.

Caesarsage avatar Feb 15 '23 02:02 Caesarsage

I think this one is pretty serious. Was investigating it today half a day. The thing is that ConnectionManager got deprecated in 3.0.0 (https://github.com/typeorm/typeorm/blob/master/CHANGELOG.md#030-2022-03-17) and apparantly it is no longer in use and typeorm-transactional-cls-hooked relays on ConnectionManager. So I think the only option is to handke new DataSource (if possible)...

szymon-mutuu avatar Mar 16 '23 19:03 szymon-mutuu

and I love the simplicity of typeorm-transactional-cls-hooked. Some alternatives I've seen require quite a lot of boilerplate.

szymon-mutuu avatar Mar 16 '23 19:03 szymon-mutuu

Same error

santimakci avatar Feb 22 '24 17:02 santimakci

Sadly, I don't think this repo is still being maintained.

You can check out https://github.com/Aliheym/typeorm-transactional

It's a forked from this repository

Same error

Caesarsage avatar Feb 22 '24 18:02 Caesarsage

Meanwhile this motivated me to try prisma and I'm happy so far

ciekawy avatar Feb 22 '24 20:02 ciekawy