diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-12-09 05:14:40 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-12-09 05:14:40 +0000 |
| commit | 8fb0c0b4ce62bcbb88845c9860f3d702cb5b36e0 (patch) | |
| tree | a39e27e3a399d142711967e4dec991db43c53226 | |
| parent | acdb90784b84bc66e15e4295dd87ce30734d4025 (diff) | |
| download | sqlalchemy-8fb0c0b4ce62bcbb88845c9860f3d702cb5b36e0.tar.gz | |
remove redundant identity map set
| -rw-r--r-- | lib/sqlalchemy/orm/unitofwork.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/unitofwork.py b/lib/sqlalchemy/orm/unitofwork.py index 02c230d08..19642cc9d 100644 --- a/lib/sqlalchemy/orm/unitofwork.py +++ b/lib/sqlalchemy/orm/unitofwork.py @@ -122,14 +122,15 @@ class UnitOfWork(object): elif state.dict['_instance_key'] != instance_key: # primary key switch - self.identity_map[instance_key] = state.obj() del self.identity_map[state.dict['_instance_key']] state.dict['_instance_key'] = instance_key if hasattr(state, 'insert_order'): delattr(state, 'insert_order') + self.identity_map[state.dict['_instance_key']] = state.obj() state.commit_all() + # remove from new last, might be the last strong ref self.new.pop(state, None) |
