diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-10-30 14:40:10 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-10-30 14:40:10 +0000 |
| commit | bba54e320df55d50f55715805498dc3ce8584991 (patch) | |
| tree | 913be504d1c22a57ab2276c7f1ef99128e844ffa /lib/sqlalchemy | |
| parent | c2a6ebb96ed153c82d49bc269154e9f53f685e65 (diff) | |
| download | sqlalchemy-bba54e320df55d50f55715805498dc3ce8584991.tar.gz | |
the recent change to garbage collection of InstanceState meant that
the deferred lambda: created by lazy_clause would get a state with
no dict. creates strong reference to the object now.
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/orm/strategies.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/strategies.py b/lib/sqlalchemy/orm/strategies.py index 3c156b70f..1962a7e2d 100644 --- a/lib/sqlalchemy/orm/strategies.py +++ b/lib/sqlalchemy/orm/strategies.py @@ -368,7 +368,8 @@ class LazyLoader(AbstractRelationLoader): # use the "committed" (database) version to get query column values # also its a deferred value; so that when used by Query, the committed value is used # after an autoflush occurs - bindparam.value = lambda: mapper._get_committed_state_attr_by_column(state, bind_to_col[bindparam.key]) + o = state.obj() # strong ref + bindparam.value = lambda: mapper._get_committed_attr_by_column(o, bind_to_col[bindparam.key]) if self.parent_property.secondary and alias_secondary: criterion = sql_util.ClauseAdapter(self.parent_property.secondary.alias()).traverse(criterion) |
