Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for nested transactions/ savepoints #105

Open
chaserelock opened this issue Apr 24, 2019 · 5 comments
Open

Documentation for nested transactions/ savepoints #105

chaserelock opened this issue Apr 24, 2019 · 5 comments
Assignees

Comments

@chaserelock
Copy link

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
Copy link

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

@cjancsar
Copy link

cjancsar commented Oct 22, 2019

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
Copy link

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
Copy link

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

@ephys ephys transferred this issue from sequelize/sequelize Apr 16, 2022
@danyal-36
Copy link

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

@ephys ephys removed the type: docs label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants