]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Don't run pending_to_persistent for non-new objects
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 9 Feb 2019 06:46:06 +0000 (01:46 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 9 Feb 2019 19:39:03 +0000 (14:39 -0500)
commit9ca2c2d254dc6a0891e66910b640c97e357ae109
tree6571f57f19b282e1a05bd6c03881789ac2e4cf5b
parent05e3b1c27429b7435ea8b6a4ef05d52dc8c99d30
Don't run pending_to_persistent for non-new objects

Fixed fairly simple but critical issue where the
:meth:`.SessionEvents.pending_to_persistent` event would be invoked for
objects not just when they move from pending to persistent, but when they
were also already persistent and just being updated, thus causing the event
to be invoked for all objects on every update.

Fixes: #4489
Change-Id: Ibe147020aa62f7d605cb1029b7f3b776f42e6b43
(cherry picked from commit b2afef966dcc44e991f22a8fb68de4f1220bd674)
doc/build/changelog/unreleased_12/4489.rst [new file with mode: 0644]
lib/sqlalchemy/orm/session.py
lib/sqlalchemy/orm/unitofwork.py
test/orm/test_events.py