Commit ee626d10 authored by Jim Fulton's avatar Jim Fulton

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.
parent b43c3f1a
......@@ -101,6 +101,7 @@ class FileStorage(
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 @@ class FileStorage(
raise FileStorageQuotaError(
"The storage quota has been exceeded.")
return self._tid
finally:
self._lock_release()
......
......@@ -981,9 +981,6 @@ class IExternalGC(IStorage):
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.
......
......@@ -31,10 +31,11 @@ transaction ourselves.
>>> 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 @@ gone:
>>> import time
>>> db.pack(time.time()+1)
>>> time.sleep(1)
>>> storage.load(oid0, '') # doctest: +ELLIPSIS
Traceback (most recent call last):
...
......@@ -101,7 +105,8 @@ isn't current:
>>> 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 ...
......
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