Repository navigation
Conversation
ROLLBACK TO SAVEPOINT keeps the savepoint, so it should be released once it is no longer needed. Matches the Savepoint.rollback() dartdoc added in serverpod/serverpod#6019. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Open
8 tasks done
|
|
||
| In the example, we create a savepoint after inserting a company. We then insert an employee but invoke a rollback to our savepoint. This results in the database preserving the company but not the employee insertion. | ||
|
|
||
| The savepoint stays established after a rollback, so you can roll back to it again. Call `release` once you no longer need it. Otherwise, it keeps a nesting level open until the transaction ends. When you catch an error and roll back, release the savepoint afterwards: |
Contributor
There was a problem hiding this comment.
Suggestion: "keeps a nesting level open" is database jargon most readers won't know. This says the same in plain words:
Suggested change
| The savepoint stays established after a rollback, so you can roll back to it again. Call `release` once you no longer need it. Otherwise, it keeps a nesting level open until the transaction ends. When you catch an error and roll back, release the savepoint afterwards: | |
| The savepoint stays established after a rollback, so you can roll back to it again. Call `release` once you no longer need it, or it stays open until the transaction ends. When you catch an error and roll back, release the savepoint afterwards: |
Contributor
|
Suggestion: The same behavior ships in 4.0.0 and 4.1.x, and the savepoint sections in |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ROLLBACK TO SAVEPOINTundoes the work after a savepoint but keeps the savepoint established, and onlyRELEASE SAVEPOINTends it (PostgreSQL docs). The Transactions page didn't say this, so code that catches an error and rolls back leaves a savepoint open until the transaction ends.This adds a short paragraph and an example under "Rolling back to savepoints" that release the savepoint after rolling back. The wording matches the
Savepoint.rollback()dartdoc added in serverpod/serverpod#6019, which the reviewer asked to have documented here.Only
docs/is changed, not the versioned docs.markdownlintpasses on the page; I didn't run the full Docusaurus build.🤖 Generated with Claude Code