zope.session SessionData generates unnecessary ConflictErrors
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 3 |
Fix Released
|
Medium
|
Gary Poster |
Bug Description
The use of zope.minmax.Maximum in zope.session.
Unfortunately, setting a property, even if it then delegates to another Persistent object, triggers the Persistent __setattr__ hook. Therefore, SessionData gets an _p_changed = True, even though nothing has changed; and meaningless ConflictErrors on the SessionData object occur, when in fact the state hasn't changed.
Not checking for the equality of states is a reasonable default speed decision for the ZODB.
To fix, we have at least two options.
One is to write an _p_resolveConflict for SessionData that declares the conflict resolved if there is no difference between the two states. This is a bit heavy, but is the more transparent fix.
Another is to change the set access of SessionData.
I intend to fix today using the second approach, releasing as a bugfix in the 3.5 line. 3.6 may want to deprecate the old property set. I will include comments to that effect.
Changed in zope3: | |
assignee: | nobody → garyposter |
r87351
released as zope.session 3.5.2