Skip to content

INTPYTHON-355 Add transaction.atomic() #357

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

Merged
merged 1 commit into from
Aug 11, 2025
Merged

Conversation

timgraham
Copy link
Collaborator

@timgraham timgraham commented Aug 6, 2025

No description provided.

@timgraham timgraham marked this pull request as ready for review August 8, 2025 19:15
Comment on lines 153 to 156
self.session = None
# Tracks if the connection is in a transaction managed by
# django_mongodb_backend.transaction.atomic. `in_atomic_block` isn't
# used in case Django's atomic() (used internally in Django) is called
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

# The first item in the tuple (an empty list) is normally the
# savepoint IDs, which isn't applicable on MongoDB.
self.run_on_commit.append(([], func, robust))
else:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mh, elif could be use with rebuts then else for the rest.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied from Django, so would rather keep it as is to make incorporating any future changes easier.

@timgraham timgraham force-pushed the atomic branch 2 times, most recently from 11677ed to 5bb8d76 Compare August 11, 2025 01:20
@timgraham timgraham merged commit 840abb6 into mongodb:main Aug 11, 2025
17 checks passed
@timgraham timgraham deleted the atomic branch August 11, 2025 02:08
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

Successfully merging this pull request may close these issues.

4 participants