transaction.abort: Incomplete cleanup for new objects

Bug #615758 reported by Dieter Maurer
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released

Bug Description

As the following "DocTest" demonstrates, "abort" forgets to reset "_p_changed" for new (i.e. "added") objects.

>>> from ZODB.DemoStorage import DemoStorage
>>> from ZODB.DB import DB
>>> from persistent import Persistent
>>> from transaction import abort
>>> class P(Persistent): pass
>>> db = DB(DemoStorage())
>>> c =
>>> obj = P()
>>> c.add(obj)
>>> obj.x = 1
>>> obj._p_changed
>>> abort()
>>> obj._p_changed

The fix is simple: reset "_p_changed" in "Connection._abort" for objects found in "_added".

Tags: 3.9.5
Dieter Maurer (d.maurer)
tags: added: 3.9.5
Jim Fulton (jim-zope)
Changed in zodb:
status: New → Fix Committed
Changed in zodb:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.