[Zope-Checkins] CVS: ZODB3/ZODB - Connection.py:1.74
Jeremy Hylton
jeremy@zope.com
Sat, 7 Sep 2002 12:40:59 -0400
Update of /cvs-repository/ZODB3/ZODB
In directory cvs.zope.org:/tmp/cvs-serv23797
Modified Files:
Connection.py
Log Message:
Remove code looking for None in self._invalidated.
An earlier revision (1.68) fixed invalidation code when an object had
no oid (oid == None). There is no longer anyway to get None in
_invalidated, and it has been a long time since a None there meant
"invalidate everything."
At long last, then, remove all the code deal with the invalidate
everything behavior.
=== ZODB3/ZODB/Connection.py 1.73 => 1.74 ===
--- ZODB3/ZODB/Connection.py:1.73 Sat Sep 7 12:22:16 2002
+++ ZODB3/ZODB/Connection.py Sat Sep 7 12:40:59 2002
@@ -285,8 +285,7 @@
self._creating.append(oid)
elif object._p_changed:
- if ((invalid(oid) and not hasattr(object, '_p_resolveConflict'))
- or invalid(None)):
+ if invalid(oid) and not hasattr(object, '_p_resolveConflict'):
raise ConflictError(object=object)
self._invalidating.append(oid)
@@ -348,12 +347,7 @@
self._creating.append(oid)
else:
#XXX We should never get here
- if (
- (invalid(oid) and
- not hasattr(object, '_p_resolveConflict'))
- or
- invalid(None)
- ):
+ if invalid(oid) and not hasattr(object, '_p_resolveConflict'):
raise ConflictError(object=object)
self._invalidating.append(oid)
@@ -514,8 +508,7 @@
# storage to make sure that we don't miss an invaildation
# notifications between the time we check and the time we
# read.
- invalid = self._invalid
- if invalid(oid) or invalid(None):
+ if self._invalid(oid):
if not hasattr(object.__class__, '_p_independent'):
get_transaction().register(self)
raise ReadConflictError(object=object)
@@ -605,8 +598,6 @@
self._invalidate_creating()
def tpc_begin(self, transaction, sub=None):
- if self._invalid(None): # Some nitwit invalidated everything!
- raise ConflictError("transaction already invalidated")
self._invalidating = []
self._creating = []