-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Transactions via an internal global session var #2569
Open
juannyG
wants to merge
48
commits into
MongoEngine:master
Choose a base branch
from
juannyG:transactions-global-session-ver
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
7001f1a
Sketch of transaction context manager
juannyG 04e2f1a
Scaffold session management for transactions
juannyG 5ccd144
Using a global session var within mongoengine for transactions
juannyG a77c88c
Add unit tests for transaction context manager
juannyG bc8f409
Add test cases for cross database transactions
juannyG 09f09da
Initialize mongo replica set in github workflow
juannyG 21ef092
Add checks for versions of Mongo
juannyG 447648a
Explicitly check if mongo major version is >=4
juannyG 9bc8e7b
Update tests to account for pymongo support
juannyG 237d007
Update tests to use recommended requirement decorators
juannyG 77f76db
Merge branch 'master' into transactions-global-session-ver
juannyG ccd8a0f
Revert item frequenices map reduce formatting structure to original
juannyG 7fbd52c
Add test cases to depict nested transaction behavior
juannyG 471a700
Provide thread safety for sessions
juannyG 9765278
Add tests showing behavior of session management in nested txs
juannyG 9861da6
Merge branch 'MongoEngine:master' into transactions-global-session-ver
juannyG 8009c6a
Upon disconnect, clear any and all outstanding sessions
juannyG 196c1af
Merge branch 'master' into transactions-global-session-ver
juannyG d7a6b02
Reset map reduce function definition
juannyG 19ef553
Merge branch 'MongoEngine:master' into transactions-global-session-ver
juannyG 16ba0b9
Add minimal placeholders for pymongo session and transaction kwargs t…
juannyG 7032387
Add myself to AUTHORS
juannyG 533220f
Merge branch 'MongoEngine:master' into transactions-global-session-ver
juannyG 1707630
Update context_managers.py based on black
juannyG 7d3db87
Experiment to deal with max lock request timeout
juannyG df87f82
Add missing pymongo import
juannyG aa6036a
Setup retry mechanism to account for lock request timeout exception
juannyG db279df
Strengthen the stability of thread test
juannyG 3fd1867
Explicitly handle retry of TransientTransactionError, per docs
juannyG e02d294
Fix bug: errorLabels is a key, not a property
juannyG bb2efb0
Handle TransientTransactionError in nested tx test case
juannyG 44c9c30
Account for pymongo>=4 host name management in replSet connections
juannyG 1124532
Merge branch 'master' into transactions-global-session-ver
juannyG 4a76e95
Merge branch 'master' into transactions-global-session-ver
juannyG 6df06ab
Merge branch 'master' of github.com:juannyG/mongoengine
juannyG 4ab761f
Merge branch 'master' into transactions-global-session-ver
juannyG de1496d
Merge branch 'master' of github.com:juannyG/mongoengine
juannyG 60c0224
Merge branch 'master' into transactions-global-session-ver
juannyG 3c0ae4f
Address PR feedback
juannyG 4a7d24a
Add doc string for run_in_transaction context manager
juannyG a1233fd
Merge branch 'MongoEngine:master' into master
juannyG 882f1e3
Abstract `with_transaction` as opposed to `start_transaction`
juannyG 68e2d94
Wrap transaction test wtih gte_40 decorator
juannyG 58cfa14
Merge branch 'master' into transactions-global-session-ver
juannyG de951dc
Remove tests related to nested transactions
juannyG 13cc855
Move `run_in_transaction` and related tests
juannyG 0729223
Simplify test_multiple_connection_settings assertion
juannyG 9ca4cdd
Clean up run_in_transaction doc string
juannyG File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PyMongo's with_transaction returns the callback's value so I believe this should be
return session.with_transaction(...)
. Otherwise it becomes unwieldy to return a value.