MCPcopy
hub / github.com/sequelize/sequelize / forceCleanup

Method forceCleanup

src/transaction.js:189–199  ·  view source on GitHub ↗

* 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.

()

Source from the content-addressed store, hash-verified

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;

Callers 2

commitMethod · 0.95
rollbackMethod · 0.95

Calls 2

_clearClsMethod · 0.95
destroyConnectionMethod · 0.65

Tested by

no test coverage detected