MCPcopy
hub / github.com/sequelize/sequelize / commit

Method commit

lib/transaction.js:54–68  ·  lib/transaction.js::Transaction.commit

* Commit the transaction * * @returns {Promise}

()

Source from the content-addressed store, hash-verified

52 * @returns {Promise}
53 */
54 async commit() {
55 if (this.finished) {
56 throw new Error(`Transaction cannot be committed because it has been finished with state: ${this.finished}`);
57 }
58
59 try {
60 return await this.sequelize.getQueryInterface().commitTransaction(this, this.options);
61 } finally {
62 this.finished = class="st">'commit';
63 this.cleanup();
64 for (const hook of this._afterCommitHooks) {
65 await hook.apply(this, [this]);
66 }
67 }
68 }
69
70 /**
71 * Rollback (abort) the transaction

Callers 13

transactionMethod · 0.95
transactFunction · 0.80
nestedTransactFunction · 0.80
findOrCreateMethod · 0.80
model.test.jsFile · 0.80
verifyDeadlockFunction · 0.80
newTransactionFuncFunction · 0.80
sequelize.test.jsFile · 0.80
create.test.jsFile · 0.80

Calls 3

cleanupMethod · 0.95
commitTransactionMethod · 0.80
getQueryInterfaceMethod · 0.80

Tested by 3

verifyDeadlockFunction · 0.64
newTransactionFuncFunction · 0.64