* Kills the connection this transaction uses. * Used as a last resort, for instance because COMMIT or ROLLBACK resulted in an error * and the transaction is left in a broken state, * and releasing the connection to the pool would be dangerous.
()
| 187 | * and releasing the connection to the pool would be dangerous. |
| 188 | */ |
| 189 | async forceCleanup() { |
| 190 | // Don't release the connection if there's a parent transaction or |
| 191 | // if we've already cleaned up |
| 192 | if (this.parent || this.connection.uuid === undefined) { |
| 193 | return; |
| 194 | } |
| 195 | |
| 196 | this._clearCls(); |
| 197 | await this.sequelize.connectionManager.destroyConnection(this.connection); |
| 198 | this.connection.uuid = undefined; |
| 199 | } |
| 200 | |
| 201 | _clearCls() { |
| 202 | const cls = this.sequelize.constructor._cls; |
no test coverage detected