ZODB.Connection.rollback may cause custom _p_invalidate to load wrong state

Bug #428039 reported by Jacob Holm
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ZODB
Status tracked in 3.9
3.10
Fix Released
Undecided
Unassigned
3.9
Fix Released
High
Unassigned

Bug Description

ZODB.Connection._rollback invalidates the cache before resetting the TmpStore. This causes any _p_invalidate methods to be called while the state has not yet been rolled back. This means that a custom _p_invalidate that loads the object after calling Persistent._p_invalidate, will load the wrong state.

AFAICT, the bug is present in all versions of ZODB that support savepoints.

The fix is simple, see attached patch against the trunk r103853 (including test).

Revision history for this message
Jacob Holm (jacobholm) wrote :
description: updated
Jim Fulton (jim-zope)
Changed in zodb:
importance: Undecided → High
Revision history for this message
Jim Fulton (jim-zope) wrote :

Much thanks for a patch that included a test!

Changed in zodb:
status: New → Fix Committed
milestone: none → 3.9.5
milestone: 3.9.5 → 3.10.0a2
milestone: 3.10.0a2 → 3.9.5
Revision history for this message
Tres Seaver (tseaver) wrote :
Revision history for this message
Tres Seaver (tseaver) wrote :

Fix released with ZODB 3.9.5:

 http://pypi.python.org/pypi/ZODB3/3.9.5#id1

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.