transaction.abort: Incomplete cleanup for new objects

Bug #615758 reported by Dieter Maurer on 2010-08-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ZODB
Undecided
Unassigned

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 = db.open()
>>>
>>> obj = P()
>>> c.add(obj)
>>> obj.x = 1
>>> obj._p_changed
True
>>> abort()
>>> obj._p_changed
True

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

Dieter Maurer (d.maurer) on 2010-08-10
tags: added: 3.9.5
Jim Fulton (jim-zope) on 2010-09-10
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  Edit
Everyone can see this information.

Other bug subscribers