website icon indicating copy to clipboard operation
website copied to clipboard

Documentation for nested transactions/ savepoints

Open chaserelock opened this issue 6 years ago • 5 comments

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

That 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

chaserelock avatar Apr 24 '19 23:04 chaserelock

PR is welcome, there's some minor docs in the TS section of sequelize.

SimonSchick avatar Apr 26 '19 10:04 SimonSchick

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

cjancsar avatar Oct 22 '19 17:10 cjancsar

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

gabegorelick avatar Aug 06 '20 16:08 gabegorelick

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

github-actions[bot] avatar Nov 12 '21 00:11 github-actions[bot]

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

danyal-36 avatar Apr 28 '22 10:04 danyal-36