-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QueryBuilder
: use a nested session in iterall
and iterdict
This will prevent the `ModelWrapper` from calling commit on the session when any of the yielded results is mutated as this will cause the cursor of the connection to be reset and it to become invalid. In the next iteration of the yield an exception will be raised. Note that a session transaction should only be opened if we are not already inside one, in which case a `nullcontext` is used.
- Loading branch information
Showing
1 changed file
with
39 additions
and
23 deletions.
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