diff options
-rw-r--r-- | lib/sqlalchemy/orm/unitofwork.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/unitofwork.py b/lib/sqlalchemy/orm/unitofwork.py index 103af4513..0992bfe99 100644 --- a/lib/sqlalchemy/orm/unitofwork.py +++ b/lib/sqlalchemy/orm/unitofwork.py @@ -43,7 +43,7 @@ class UOWEventHandler(interfaces.AttributeExtension): if sess: prop = _state_mapper(state).get_property(self.key) if prop.cascade.save_update and item not in sess: - sess.save_or_update(item) + sess.add(item) return item def remove(self, state, item, initiator): @@ -64,7 +64,7 @@ class UOWEventHandler(interfaces.AttributeExtension): if sess: prop = _state_mapper(state).get_property(self.key) if newvalue is not None and prop.cascade.save_update and newvalue not in sess: - sess.save_or_update(newvalue) + sess.add(newvalue) if prop.cascade.delete_orphan and oldvalue in sess.new: sess.expunge(oldvalue) return newvalue |