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
522 stars 86 forks source link

can't add new command when connection is in closed state #117

Closed nguyentuan7277 closed 1 year ago

nguyentuan7277 commented 1 year ago

Steps to reproduce or a small repository showing the problem: { QueryFailedError: Can't add new command when connection is in closed state | at new QueryFailedError (/usr/src/my-app/src/error/QueryFailedError.ts:9:9) | at Query.onResult (/usr/src/my-app/src/driver/mysql/MysqlQueryRunner.ts:166:37) | at PoolConnection._addCommandClosedState (/usr/src/my-app/node_modules/mysql2/lib/connection.js:139:11) | at PoolConnection.query (/usr/src/my-app/node_modules/mysql2/lib/connection.js:534:17) | at MysqlQueryRunner. (/usr/src/my-app/src/driver/mysql/MysqlQueryRunner.ts:155:36) | at step (/usr/src/my-app/node_modules/tslib/tslib.js:136:27) | at Object.next (/usr/src/my-app/node_modules/tslib/tslib.js:117:57) | at fulfilled (/usr/src/my-app/node_modules/tslib/tslib.js:107:62) | at process._tickCallback (internal/process/next_tick.js:68:7) | message: 'Can\'t add new command when connection is in closed state', | fatal: true, | name: 'QueryFailedError', | query: 'COMMIT', | parameters: [] } }