summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/dependency.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-02-25 23:20:05 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2021-02-28 22:28:24 -0500
commit04861dfd0e75e6fff3aa730bcad27f3172ae2fd8 (patch)
tree7e4c2b038eb7f665584fdee345c1089079f0d93c /lib/sqlalchemy/orm/dependency.py
parentdc615763d39916e9c037c7c376db1817cdf02764 (diff)
downloadsqlalchemy-04861dfd0e75e6fff3aa730bcad27f3172ae2fd8.tar.gz
disable all raiseload within the unit of work process.
The unit of work process now turns off all "lazy='raise'" behavior altogether when a flush is proceeding. While there are areas where the UOW is sometimes loading things that aren't ultimately needed, the lazy="raise" strategy is not helpful here as the user often does not have much control or visibility into the flush process. Fixes: #5984 Change-Id: I23f2e332a5faa5c7c29823c9be9434d129676a5a
Diffstat (limited to 'lib/sqlalchemy/orm/dependency.py')
-rw-r--r--lib/sqlalchemy/orm/dependency.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/dependency.py b/lib/sqlalchemy/orm/dependency.py
index 5a329b28c..85f6b68ff 100644
--- a/lib/sqlalchemy/orm/dependency.py
+++ b/lib/sqlalchemy/orm/dependency.py
@@ -229,6 +229,11 @@ class DependencyProcessor(object):
if not isdelete or self.passive_deletes:
passive = attributes.PASSIVE_NO_INITIALIZE
elif self.direction is MANYTOONE:
+ # here, we were hoping to optimize having to fetch many-to-one
+ # for history and ignore it, if there's no further cascades
+ # to take place. however there are too many less common conditions
+ # that still take place and tests in test_relationships /
+ # test_cascade etc. will still fail.
passive = attributes.PASSIVE_NO_FETCH_RELATED
else:
passive = attributes.PASSIVE_OFF