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

Transaction management #131

Open
WhyNotHugo opened this issue May 14, 2022 · 2 comments
Open

Transaction management #131

WhyNotHugo opened this issue May 14, 2022 · 2 comments

Comments

@WhyNotHugo
Copy link
Owner

Validating recepts handles DB transactions by itself just fine.

Using this can be dangerous:

with transaction.atomic()
    receipt.validate()

If there's a failure during this call, the can be irrecoverable data loss. validate() should internally check that no transaction is ongoing, and raise ProgramingError() if it is being run inside a transaction.

@WhyNotHugo
Copy link
Owner Author

Error message should suggest reading the validate() docstring.

@juanpsenn
Copy link
Contributor

May be a check if validate is not running in an atomic context should be fine?

WhyNotHugo pushed a commit that referenced this issue May 24, 2022
WhyNotHugo pushed a commit that referenced this issue May 24, 2022
WhyNotHugo pushed a commit that referenced this issue May 24, 2022
WhyNotHugo pushed a commit that referenced this issue May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants