Open chaserelock opened 5 years ago
PR is welcome, there's some minor docs in the TS section of sequelize.
Googling about how to use savepoints led me to this undocumented feature. From here: https://stackoverflow.com/questions/38069797/easy-way-to-handle-nested-transactions
Longer form docs would certainly be great, but the JSDoc for sequelize.transaction
should also be updated to include the transaction
option: https://github.com/sequelize/sequelize/blob/e1446837196c07b8ff0c23359b958d68af40fd6d/src/sequelize.js#L1076-L1085
Also needed in transaction.js
: https://github.com/sequelize/sequelize/blob/e1446837196c07b8ff0c23359b958d68af40fd6d/src/transaction.js#L13-L19
This issue has been automatically marked as stale because it has been open for 14 days without activity. It will be closed if no further activity occurs within the next 14 days. If this is still an issue, just leave a comment or remove the "stale" label. 🙂
Well I am having a different type of issue I am reverting some of my data in one transaction and using the same data to add new in my second transaction, in my scenario I cannot commit after my first transaction because what if my second transaction fails it will have to be reverted Any help
I believe this holds true for v4 and v5. The transaction options object can take the key
transaction
which will be set to this.parent https://github.com/sequelize/sequelize/blob/v4/lib/transaction.jsThat is not reflected in the documentation for transaction, nor any SAVEPOINTing behavior: http://docs.sequelizejs.com/class/lib/sequelize.js~Sequelize.html#instance-method-transaction