[Zodb-checkins] CVS: Zope/lib/python/ZODB - ActivityMonitor.py:1.3.6.3 BaseStorage.py:1.21.2.4 Connection.py:1.72.6.3 DB.py:1.43.6.2 FileStorage.py:1.98.2.6 TimeStamp.c:1.15.60.3 Transaction.py:1.37.6.3 cPersistence.c:1.62.10.3 cPickleCache.c:1.68.10.2 coptimizations.c:1.17.60.6

Barry Warsaw barry@wooz.org
Thu, 30 Jan 2003 18:25:54 -0500


Update of /cvs-repository/Zope/lib/python/ZODB
In directory cvs.zope.org:/tmp/cvs-serv23601/lib/python/ZODB

Modified Files:
      Tag: Zope-2_6-branch
	ActivityMonitor.py BaseStorage.py Connection.py DB.py 
	FileStorage.py TimeStamp.c Transaction.py cPersistence.c 
	cPickleCache.c coptimizations.c 
Log Message:
Port changes on the ZODB 3.1.1 release branch to Zope 2.6 branch for
the next beta.


=== Zope/lib/python/ZODB/ActivityMonitor.py 1.3.6.2 => 1.3.6.3 ===


=== Zope/lib/python/ZODB/BaseStorage.py 1.21.2.3 => 1.21.2.4 ===


=== Zope/lib/python/ZODB/Connection.py 1.72.6.2 => 1.72.6.3 ===


=== Zope/lib/python/ZODB/DB.py 1.43.6.1 => 1.43.6.2 ===


=== Zope/lib/python/ZODB/FileStorage.py 1.98.2.5 => 1.98.2.6 ===
--- Zope/lib/python/ZODB/FileStorage.py:1.98.2.5	Thu Dec 19 00:00:54 2002
+++ Zope/lib/python/ZODB/FileStorage.py	Thu Jan 30 18:25:13 2003
@@ -318,7 +318,7 @@
 
     def _newIndexes(self):
         # hook to use something other than builtin dict
-        return {}, {}, {}, {}
+        return fsIndex(), {}, {}, {}
 
     _saved = 0
     def _save_index(self):
@@ -452,6 +452,24 @@
         if index is None or pos is None or oid is None or vindex is None:
             return None
         pos = long(pos)
+
+        if type(index) is type({}) and (not self._is_read_only):
+            # Convert to fsIndex
+            newindex = fsIndex()
+            if type(newindex) is not type(index):
+                # And we have fsIndex
+                newindex.update(index)
+
+                # Now save the index
+                f=open(index_name,'wb')
+                p=Pickler(f,1)
+                info['index'] = newindex
+                p.dump(info)
+                f.close()
+
+                # Now call this method again to get the new data
+                return self._restore_index()
+
         tid=self._sane(index, pos)
         if not tid: return None
 
@@ -2378,9 +2396,16 @@
                 warn("%s time-stamp reduction at %s", self._file.name, pos)
             self._ltid=tid
 
+            if self._stop is not None and tid > self._stop:
+                raise IndexError, index
+
+            if status == 'c':
+                # Assume we've hit the last, in-progress transaction
+                raise IndexError, index
+
             tl=U64(stl)
 
-            if pos+(tl+8) > self._file_size or status=='c':
+            if pos+(tl+8) > self._file_size:
                 # Hm, the data were truncated or the checkpoint flag wasn't
                 # cleared.  They may also be corrupted,
                 # in which case, we don't want to totally lose the data.
@@ -2414,9 +2439,6 @@
                     warn('%s has invalid transaction header at %s',
                          self._file.name, pos)
                     break
-
-            if self._stop is not None and tid > self._stop:
-                raise IndexError, index
 
             tpos=pos
             tend=tpos+tl


=== Zope/lib/python/ZODB/TimeStamp.c 1.15.60.2 => 1.15.60.3 ===


=== Zope/lib/python/ZODB/Transaction.py 1.37.6.2 => 1.37.6.3 ===
--- Zope/lib/python/ZODB/Transaction.py:1.37.6.2	Thu Jan  2 13:06:22 2003
+++ Zope/lib/python/ZODB/Transaction.py	Thu Jan 30 18:25:13 2003
@@ -257,7 +257,6 @@
                 # have to clean up.  First save the original exception
                 # in case the cleanup process causes another
                 # exception.
-                t, v, tb = sys.exc_info()
                 try:
                     self._commit_error(objects, ncommitted, jars, subjars)
                 except:
@@ -265,8 +264,7 @@
                         "A storage error occured during transaction "
                         "abort.  This shouldn't happen.",
                         error=sys.exc_info())
-                    
-                raise t, v, tb
+                raise
         finally:
             del objects[:] # clear registered
             if not subtransaction and self._id is not None:
@@ -358,7 +356,7 @@
             jar.tpc_finish(self)
         except:
             # Bug if it does, we need to keep track of it
-            LOG('ZODB', ERROR,
+            LOG('ZODB', PANIC,
                 "A storage error occurred in the last phase of a "
                 "two-phase commit.  This shouldn\'t happen. ",
                 error=sys.exc_info())
@@ -371,7 +369,7 @@
                 # The database can't guarantee consistency if call fails.
                 jar.tpc_finish(self)
         except:
-            hosed = 1
+            #hosed = 1
             LOG('ZODB', PANIC,
                 "A storage error occurred in the last phase of a "
                 "two-phase commit.  This shouldn\'t happen. "


=== Zope/lib/python/ZODB/cPersistence.c 1.62.10.2 => 1.62.10.3 ===


=== Zope/lib/python/ZODB/cPickleCache.c 1.68.10.1 => 1.68.10.2 ===
--- Zope/lib/python/ZODB/cPickleCache.c:1.68.10.1	Fri Dec 13 16:20:25 2002
+++ Zope/lib/python/ZODB/cPickleCache.c	Thu Jan 30 18:25:13 2003
@@ -430,7 +430,7 @@
 	if (PyObject_DelAttr(v, py__p_changed) < 0)
 	    PyErr_Clear();
     }
-    Py_XDECREF(v);
+    Py_DECREF(v);
 }
 
 static PyObject *


=== Zope/lib/python/ZODB/coptimizations.c 1.17.60.5 => 1.17.60.6 ===