Skip to content

Conversation

dersam
Copy link
Contributor

@dersam dersam commented Nov 3, 2022

Motivation / Background

A common misconception with transaction rollback in Rails is that exceptions will not be re-raised from nested transactions. This is only true for ActiveRecord::Rollback. The documentation for that class makes that clear.

Detail

A link to that class doc has been added in Transactions::ClassMethods, as well as an explicit restatement that all other exceptions will be re-raised.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • CI is passing.

A common misconception with transaction rollback in Rails is that
exceptions will not be re-raised from nested transactions. This is only
true for ActiveRecord::Rollback. The documentation for that class makes
that clear.

A link to that class doc has been added, as well as an explicit
restatement that all other exceptions will be re-raised.
@p8
Copy link
Member

p8 commented Nov 3, 2022

Thanks @dersam !

@p8 p8 merged commit 07f48f7 into rails:main Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants