From 91f84edd80b4470cb0c9dfca30890388af6daec8 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Wed, 12 Mar 2008 20:34:03 -0400 Subject: Add transaction API to IDatabase, e.g. begin(), commit(), and abort(). Add an implementation of these to StockDatabase. Expose 'commit' to doctest globals. --- mailman/interfaces/database.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'mailman/interfaces/database.py') diff --git a/mailman/interfaces/database.py b/mailman/interfaces/database.py index 0bacdaa3a..706613ba0 100644 --- a/mailman/interfaces/database.py +++ b/mailman/interfaces/database.py @@ -65,10 +65,14 @@ class IDatabase(Interface): This is only used by the test framework. """ - # XXX Eventually we probably need to support a transaction manager - # interface, e.g. begin(), commit(), abort(). We will probably also need - # to support a shutdown() method for cleanly disconnecting from the - # database.sy + def begin(): + """Begin the current transaction.""" + + def commit(): + """Commit the current transaction.""" + + def abort(): + """Abort the current transaction.""" list_manager = Attribute( """The IListManager instance provided by the database layer.""") -- cgit v1.2.3-70-g09d2