Commit 38646258 authored by Jeremy Hylton's avatar Jeremy Hylton

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.
parent 8e5fa55e
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
############################################################################## ##############################################################################
"""Database connection support """Database connection support
$Id: Connection.py,v 1.73 2002/09/07 16:22:16 jeremy Exp $""" $Id: Connection.py,v 1.74 2002/09/07 16:40:59 jeremy Exp $"""
from cPickleCache import PickleCache, MUCH_RING_CHECKING from cPickleCache import PickleCache, MUCH_RING_CHECKING
from POSException import ConflictError, ReadConflictError from POSException import ConflictError, ReadConflictError
...@@ -285,8 +285,7 @@ class Connection(ExportImport.ExportImport): ...@@ -285,8 +285,7 @@ class Connection(ExportImport.ExportImport):
self._creating.append(oid) self._creating.append(oid)
elif object._p_changed: elif object._p_changed:
if ((invalid(oid) and not hasattr(object, '_p_resolveConflict')) if invalid(oid) and not hasattr(object, '_p_resolveConflict'):
or invalid(None)):
raise ConflictError(object=object) raise ConflictError(object=object)
self._invalidating.append(oid) self._invalidating.append(oid)
...@@ -348,12 +347,7 @@ class Connection(ExportImport.ExportImport): ...@@ -348,12 +347,7 @@ class Connection(ExportImport.ExportImport):
self._creating.append(oid) self._creating.append(oid)
else: else:
#XXX We should never get here #XXX We should never get here
if ( if invalid(oid) and not hasattr(object, '_p_resolveConflict'):
(invalid(oid) and
not hasattr(object, '_p_resolveConflict'))
or
invalid(None)
):
raise ConflictError(object=object) raise ConflictError(object=object)
self._invalidating.append(oid) self._invalidating.append(oid)
...@@ -514,8 +508,7 @@ class Connection(ExportImport.ExportImport): ...@@ -514,8 +508,7 @@ class Connection(ExportImport.ExportImport):
# storage to make sure that we don't miss an invaildation # storage to make sure that we don't miss an invaildation
# notifications between the time we check and the time we # notifications between the time we check and the time we
# read. # read.
invalid = self._invalid if self._invalid(oid):
if invalid(oid) or invalid(None):
if not hasattr(object.__class__, '_p_independent'): if not hasattr(object.__class__, '_p_independent'):
get_transaction().register(self) get_transaction().register(self)
raise ReadConflictError(object=object) raise ReadConflictError(object=object)
...@@ -605,8 +598,6 @@ class Connection(ExportImport.ExportImport): ...@@ -605,8 +598,6 @@ class Connection(ExportImport.ExportImport):
self._invalidate_creating() self._invalidate_creating()
def tpc_begin(self, transaction, sub=None): def tpc_begin(self, transaction, sub=None):
if self._invalid(None): # Some nitwit invalidated everything!
raise ConflictError("transaction already invalidated")
self._invalidating = [] self._invalidating = []
self._creating = [] self._creating = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment