Commit 967f9c05 authored by Jim Fulton's avatar Jim Fulton

Reenabled and moved check for conflicts on read to avoid reading

inconsistent data. Added a detailed comment with explanation.

Added explanation of the semantics for calling the function passed to
the storage tpc_finish method.
parent 7c24ccab
master incremental-recovery verify-on-recovery 5.5.1 5.5.0 5.4.0 5.3.0 5.2.4 5.2.3 5.2.2 5.2.1 5.2.0 5.1.1 5.1.0 5.0.1 5.0.0 5.0.0b1 5.0.0a6 5.0.0a5 5.0.0a4 5.0.0a3 5.0.0a2 5.0.0a1 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.1 4.3.0 4.2.0 4.2.0b1 4.1.0 4.0.1 4.0.0 4.0.0b3 4.0.0b2 4.0.0b1 4.0.0a4 4.0.0a3 4.0.0a2 4.0.0a1 3.10.7 3.10.6 3.10.5 3.10.3 3.10.2 3.10.1 3.10.0 3.10.0b8 3.10.0b7 3.10.0b6 3.10.0b5 3.10.0b4 3.10.0b3 3.10.0b2 3.10.0b1 3.10.0a2 3.10.0a1 3.9.7 3.9.6 3.9.5 3.9.4 3.9.3 3.9.2 3.9.1 3.9.0 3.9.0c3 3.9.0c2 3.9.0c1 3.9.0b5 3.9.0b4 3.9.0b3 3.9.0b2 3.9.0b1 3.9.0a12 3.9.0a11 3.9.0a10 3.9.0a9 3.9.0a8 3.9.0a7 3.9.0a6 3.9.0a5 3.9.0a4 3.9.0a3 3.9.0a2 3.9.0a1 3.8.6 3.8.5 3.8.4 3.8.3 3.8.3b1 3.8.2 3.8.1 3.8.1b9 3.8.1b8 3.8.1b7 3.8.1b6 3.8.1b5 3.8.1b4 3.8.1b3 3.8.1b2 3.8.1b1 3.8.0 3.8.0c1 3.8.0b5 3.8.0b4 3.8.0b3 3.8.0b1 3.7.4 3.7.3 3.7.2 3.7.1 3.7.0 3.7.0b2 3.7.0b1 3.7-Zope-3.3.0rc1 3.6.5 3.6.4 3.6.3 3.6.2 3.6.1 3.6.0 3.6.0b6 3.6.0b5 3.6.0b4 3.6.0b3 3.6.0b2 3.6.0b1 3.6.0a4 3.6.0a3 3.6.0a2 3.6.0a1 3.5.1 3.5.1b2 3.5.1b1 3.5.0 3.5.0a8 3.5.0a7 3.5.0a6 3.5.0a5 3.5.0a4 3.5.0a3 3.5.0a2 3.5.0a1 3.4.6 3.4.5 3.4.4 3.4.3 3.4.2 3.4.2b3 3.4.2b2 3.4.2b1 3.4.1 3.4.1b5 3.4.1b4 3.4.1b3 3.4.1b2 3.4.1b1 3.4.1a6 3.4.1a5 3.4.1a4 3.4.1a3 3.4.1a2 3.4.1a1 3.4.0 3.4.0c2 3.4.0c1 3.4.0b3 3.4.0b2 3.4.0a9 3.4.0a8 3.4.0a7 3.4.0a6 3.4.0a5 3.4.0a4 3.4.0a3 3.4.0a2.1 3.4.0a2 3.4.0a1 3.3.1 3.3.1c1 3.3.1a1 3.3.0 3.3.0c1 3.3.0b2 3.3.0b1 3.3.0a2 new-doc cvs-to-svn-conversion blob-technical-preview before_transaction_remove
No related merge requests found
......@@ -84,8 +84,8 @@
##############################################################################
"""Database connection support
$Id: Connection.py,v 1.42 2001/01/15 15:49:29 chrism Exp $"""
__version__='$Revision: 1.42 $'[11:-2]
$Id: Connection.py,v 1.43 2001/01/15 18:49:49 jim Exp $"""
__version__='$Revision: 1.43 $'[11:-2]
from cPickleCache import PickleCache
from POSException import ConflictError, ExportError
......@@ -438,9 +438,22 @@ class Connection(ExportImport.ExportImport):
def setstate(self,object):
try:
oid=object._p_oid
#invalid=self._invalid
#if invalid(oid) or invalid(None): raise ConflictError, oid
p, serial = self._storage.load(oid, self._version)
# XXX this is quite conservative!
# We need, however, to avoid reading data from a transaction
# that committed after the current "session" started, as
# that might lead to mixing of cached data from earlier
# transactions and new inconsistent data.
#
# Note that we (carefully) wait until after we call the
# 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): raise ConflictError, oid
file=StringIO(p)
unpickler=Unpickler(file)
unpickler.persistent_load=self._persistent_load
......@@ -540,6 +553,13 @@ class Connection(ExportImport.ExportImport):
def tpc_finish(self, transaction):
# It's important that the storage call the function we pass
# (self.tpc_finish_) while it still has it's lock. We don't
# want another thread to be able to read any updated data
# until we've had a chance to send an invalidation message to
# all of the other connections!
self._storage.tpc_finish(transaction, self.tpc_finish_)
self._cache.invalidate(self._invalidated)
self._incrgc() # This is a good time to do some GC
......
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