sequelize / website

Our beloved website that contains all versions of our documentations and the API references.
https://sequelize.org
27 stars 149 forks source link

Documentation for nested transactions/ savepoints #105

Open chaserelock opened 5 years ago

chaserelock commented 5 years ago

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

SimonSchick commented 5 years ago

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

cjancsar commented 4 years ago

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

gabegorelick commented 3 years ago

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

github-actions[bot] commented 2 years ago

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

danyal-36 commented 2 years ago

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