odavid / typeorm-transactional-cls-hooked

A Transactional Method Decorator for typeorm that uses cls-hooked to handle and propagate transactions between different repositories and service methods. Inpired by Spring Trasnactional Annotation and Sequelize CLS
MIT License
524 stars 86 forks source link

How do i get Transaction to work ? Getting ConnectionNotFound error #116

Open Caesarsage opened 1 year ago

Caesarsage commented 1 year ago

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

ConnectionNotFoundError: Connection "default" was not found.

szymon-mutuu commented 1 year ago

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 commented 1 year ago

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

santimakci commented 8 months ago

Same error

Caesarsage commented 8 months ago

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

ciekawy commented 8 months ago

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