[prev in list] [next in list] [prev in thread] [next in thread]
List: zope-cvs
Subject: [Zope-Checkins] CVS: Packages/ZODB - Connection.py:1.98.4.9
From: Tim Peters <tim.one () comcast ! net>
Date: 2004-08-31 22:52:04
Message-ID: 20040831225204.D822620309D () mail ! zope ! org
[Download RAW message or body]
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):
_______________________________________________
Zope-Checkins maillist - Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic