[Zodb-checkins] SVN: ZODB/trunk/src/ZODB/ Changed the api for deleteObject. It no-longer returns

Jim Fulton jim at zope.com
Thu Dec 18 19:41:53 EST 2008


Log message for revision 94180:
  Changed the api for deleteObject. It no-longer returns
  anything. Returning a serial isn't practical with ZEO and it isn't
  really needed anyway.
  
  Added a missing interface declaration for IExternalGC to FileStorage.
  

Changed:
  U   ZODB/trunk/src/ZODB/FileStorage/FileStorage.py
  U   ZODB/trunk/src/ZODB/interfaces.py
  U   ZODB/trunk/src/ZODB/tests/IExternalGC.test

-=-
Modified: ZODB/trunk/src/ZODB/FileStorage/FileStorage.py
===================================================================
--- ZODB/trunk/src/ZODB/FileStorage/FileStorage.py	2008-12-19 00:41:52 UTC (rev 94179)
+++ ZODB/trunk/src/ZODB/FileStorage/FileStorage.py	2008-12-19 00:41:53 UTC (rev 94180)
@@ -101,6 +101,7 @@
         ZODB.interfaces.IStorageIteration,
         ZODB.interfaces.IStorageUndoable,
         ZODB.interfaces.IStorageCurrentRecordIteration,
+        ZODB.interfaces.IExternalGC,
         )
 
     # Set True while a pack is in progress; undo is blocked for the duration.
@@ -556,8 +557,6 @@
                 raise FileStorageQuotaError(
                     "The storage quota has been exceeded.")
 
-            return self._tid
-
         finally:
             self._lock_release()
 

Modified: ZODB/trunk/src/ZODB/interfaces.py
===================================================================
--- ZODB/trunk/src/ZODB/interfaces.py	2008-12-19 00:41:52 UTC (rev 94179)
+++ ZODB/trunk/src/ZODB/interfaces.py	2008-12-19 00:41:53 UTC (rev 94180)
@@ -981,9 +981,6 @@
        non-delete records.  The object will be removed from the
        storage when all not-delete records are removed.
 
-       The the storage's transaction id for the current transaction is
-       returned.
-
        The serial argument must match the most recently committed
        serial for the object. This is a seat belt.
 

Modified: ZODB/trunk/src/ZODB/tests/IExternalGC.test
===================================================================
--- ZODB/trunk/src/ZODB/tests/IExternalGC.test	2008-12-19 00:41:52 UTC (rev 94179)
+++ ZODB/trunk/src/ZODB/tests/IExternalGC.test	2008-12-19 00:41:53 UTC (rev 94180)
@@ -31,10 +31,11 @@
 
     >>> txn = transaction.begin()
     >>> storage.tpc_begin(txn)
-    >>> tid = storage.deleteObject(oid0, s0, txn)
-    >>> tid = storage.deleteObject(oid1, s1, txn)
+    >>> storage.deleteObject(oid0, s0, txn)
+    >>> storage.deleteObject(oid1, s1, txn)
     >>> storage.tpc_vote(txn)
     >>> storage.tpc_finish(txn)
+    >>> tid = storage.lastTransaction()
 
 Now if we try to load data for the objects, we get a POSKeyError:
 
@@ -64,6 +65,9 @@
     >>> import time
     >>> db.pack(time.time()+1)
 
+
+>>> time.sleep(1)
+
     >>> storage.load(oid0, '') # doctest: +ELLIPSIS
     Traceback (most recent call last):
     ...
@@ -101,7 +105,8 @@
 
     >>> txn = transaction.begin()
     >>> storage.tpc_begin(txn)
-    >>> storage.deleteObject(oid, bad_serial, txn) # doctest: +ELLIPSIS
+    >>> storage.deleteObject(oid, bad_serial, txn); storage.tpc_vote(txn)
+    ... # doctest: +ELLIPSIS
     Traceback (most recent call last):
     ...
     ConflictError: database conflict error ...



More information about the Zodb-checkins mailing list