[Zodb-checkins] SVN: ZODB/branches/jim-dev/src/ZODB/interfaces.py
Added two more methods to IDatabase
Dmitry Vasiliev
dima at hlabs.spb.ru
Fri Oct 20 08:06:14 EDT 2006
Log message for revision 70841:
Added two more methods to IDatabase
Changed:
U ZODB/branches/jim-dev/src/ZODB/interfaces.py
-=-
Modified: ZODB/branches/jim-dev/src/ZODB/interfaces.py
===================================================================
--- ZODB/branches/jim-dev/src/ZODB/interfaces.py 2006-10-20 12:02:39 UTC (rev 70840)
+++ ZODB/branches/jim-dev/src/ZODB/interfaces.py 2006-10-20 12:06:14 UTC (rev 70841)
@@ -18,6 +18,7 @@
from zope.interface import Interface, Attribute
+
class IConnection(Interface):
"""Connection to ZODB for loading and storing objects.
@@ -371,6 +372,41 @@
include useful objects.
"""
+ # TODO: Should this method be moved into some subinterface?
+ def pack(t=None, days=0):
+ """Pack the storage, deleting unused object revisions.
+
+ A pack is always performed relative to a particular time, by
+ default the current time. All object revisions that are not
+ reachable as of the pack time are deleted from the storage.
+
+ The cost of this operation varies by storage, but it is
+ usually an expensive operation.
+
+ There are two optional arguments that can be used to set the
+ pack time: t, pack time in seconds since the epcoh, and days,
+ the number of days to subtract from t or from the current
+ time if t is not specified.
+ """
+
+ # TODO: Should this method be moved into some subinterface?
+ def undo(id, txn=None):
+ """Undo a transaction identified by id.
+
+ A transaction can be undone if all of the objects involved in
+ the transaction were not modified subsequently, if any
+ modifications can be resolved by conflict resolution, or if
+ subsequent changes resulted in the same object state.
+
+ The value of id should be generated by calling undoLog()
+ or undoInfo(). The value of id is not the same as a
+ transaction id used by other methods; it is unique to undo().
+
+ id: a storage-specific transaction identifier
+ txn: transaction context to use for undo().
+ By default, uses the current transaction.
+ """
+
def close():
"""Close the database and its underlying storage.
More information about the Zodb-checkins
mailing list