Hi,

Jim Fulton wrote:
Log message for revision 67595:
  Added compatibility for old pickles.
Modified: Zope3/branches/jim-adapter/src/zope/app/component/tests/test_registration.py
+# Work around a bug in ZODB
+# XXX fix ZODB
+class FileStorage(ZODB.FileStorage.FileStorage):
+ + def new_oid(self):
+        self._lock_acquire()
+        try:
+            last = self._oid
+            d = ord(last[-1])
+            if d < 255:  # fast path for the usual case
+                last = last[:-1] + chr(d+1)
+            else:        # there's a carry out of the last byte
+                last_as_long, = _structunpack(">Q", last)
+                last = _structpack(">Q", last_as_long + 1)
+            self._oid = last
+            return last
+        finally:
+             self._lock_release()
+ +

What's the ZODB bug? Why would new_oid be called for a readonly storage (which the original code checks)?

Florent

--
Florent Guillaume, Nuxeo (Paris, France)   Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev

Reply via email to