From: Mike Bayer Date: Sun, 9 Dec 2007 05:14:40 +0000 (+0000) Subject: remove redundant identity map set X-Git-Tag: rel_0_4_2~83 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8fb0c0b4ce62bcbb88845c9860f3d702cb5b36e0;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git remove redundant identity map set --- diff --git a/lib/sqlalchemy/orm/unitofwork.py b/lib/sqlalchemy/orm/unitofwork.py index 02c230d08d..19642cc9d1 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)