summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/loading.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-02-18 16:08:19 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2015-02-18 16:08:19 -0500
commit3209a73b92e17dd351a50c41352791baeefcd846 (patch)
tree2598487e5032baa9847fa11fbe9b34ee64596f7e /lib/sqlalchemy/orm/loading.py
parent3eff76c4b0c234717e6d8a157ef6883b72694927 (diff)
downloadsqlalchemy-3209a73b92e17dd351a50c41352791baeefcd846.tar.gz
- Mapped state internals have been reworked to allow for a 50% reduction
in callcounts specific to the "expiration" of objects, as in the "auto expire" feature of :meth:`.Session.commit` and for :meth:`.Session.expire_all`, as well as in the "cleanup" step which occurs when object states are garbage collected. fixes #3307
Diffstat (limited to 'lib/sqlalchemy/orm/loading.py')
-rw-r--r--lib/sqlalchemy/orm/loading.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sqlalchemy/orm/loading.py b/lib/sqlalchemy/orm/loading.py
index fdc787545..c59257039 100644
--- a/lib/sqlalchemy/orm/loading.py
+++ b/lib/sqlalchemy/orm/loading.py
@@ -146,7 +146,7 @@ def get_from_identity(session, key, passive):
# expired state will be checked soon enough, if necessary
return instance
try:
- state(state, passive)
+ state._load_expired(state, passive)
except orm_exc.ObjectDeletedError:
session._remove_newly_deleted([state])
return None
@@ -411,11 +411,11 @@ def _populate_full(
for key, set_callable in populators["expire"]:
dict_.pop(key, None)
if set_callable:
- state.callables[key] = state
+ state.expired_attributes.add(key)
else:
for key, set_callable in populators["expire"]:
if set_callable:
- state.callables[key] = state
+ state.expired_attributes.add(key)
for key, populator in populators["new"]:
populator(state, dict_, row)
for key, populator in populators["delayed"]:
@@ -445,7 +445,7 @@ def _populate_partial(
if key in to_load:
dict_.pop(key, None)
if set_callable:
- state.callables[key] = state
+ state.expired_attributes.add(key)
for key, populator in populators["new"]:
if key in to_load:
populator(state, dict_, row)