[Zodb-checkins] CVS: Packages/ZODB - Connection.py:1.98.4.9
Tim Peters
tim.one at comcast.net
Tue Aug 31 18:52:04 EDT 2004
Update of /cvs-repository/Packages/ZODB
In directory cvs.zope.org:/tmp/cvs-serv6620/lib/python/ZODB
Modified Files:
Tag: Zope-2_7-branch
Connection.py
Log Message:
_handle_independent(): Failed to record that a ReadConflictError was
raised for an object with a _p_independent() method that returned
false.
=== Packages/ZODB/Connection.py 1.98.4.8 => 1.98.4.9 ===
--- Packages/ZODB/Connection.py:1.98.4.8 Tue Aug 31 18:07:21 2004
+++ Packages/ZODB/Connection.py Tue Aug 31 18:51:34 2004
@@ -97,6 +97,15 @@
self._inv_lock = threading.Lock()
self._invalidated = d = {}
self._invalid = d.has_key
+
+ # We intend to prevent committing a transaction in which
+ # ReadConflictError occurs. _conflicts is the set of oids that
+ # experienced ReadConflictError. Any time we raise ReadConflictError,
+ # the oid should be added to this set, and we should be sure that the
+ # object is registered with the transaction. Because it's registered,
+ # Transaction.commit() will call Connection.commit() for it, and the
+ # latter will raise ReadConflictError again (because the oid is in
+ # _conflicts).
self._conflicts = {}
# We want to raise ConnectionStateError if an attempt to close is
@@ -650,6 +659,7 @@
self._inv_lock.release()
else:
self.getTransaction().register(obj)
+ self._conflicts[obj._p_oid] = 1
raise ReadConflictError(object=obj)
def _ignore_conflict(self, oid):
More information about the Zodb-checkins
mailing list