summaryrefslogtreecommitdiff
path: root/mailman/database/__init__.py
diff options
context:
space:
mode:
authorBarry Warsaw2008-03-12 20:34:03 -0400
committerBarry Warsaw2008-03-12 20:34:03 -0400
commit91f84edd80b4470cb0c9dfca30890388af6daec8 (patch)
treee6cd540bfb2f575ce65e41ac2de4b9fc3d0631fe /mailman/database/__init__.py
parent4e2070ca3d8bca288cbc2d96771a78c22a7ec031 (diff)
downloadmailman-91f84edd80b4470cb0c9dfca30890388af6daec8.tar.gz
mailman-91f84edd80b4470cb0c9dfca30890388af6daec8.tar.zst
mailman-91f84edd80b4470cb0c9dfca30890388af6daec8.zip
Diffstat (limited to 'mailman/database/__init__.py')
-rw-r--r--mailman/database/__init__.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/mailman/database/__init__.py b/mailman/database/__init__.py
index 1615c291f..dabe70c79 100644
--- a/mailman/database/__init__.py
+++ b/mailman/database/__init__.py
@@ -45,6 +45,8 @@ from mailman.interfaces import IDatabase, SchemaVersionMismatchError
class StockDatabase:
+ """The standard database, using Storm on top of SQLite."""
+
implements(IDatabase)
def __init__(self):
@@ -56,6 +58,7 @@ class StockDatabase:
self._store = None
def initialize(self, debug=None):
+ """See `IDatabase`."""
# Serialize this so we don't get multiple processes trying to create
# the database at the same time.
with Lock(os.path.join(config.LOCK_DIR, 'dbcreate.lck')):
@@ -66,6 +69,19 @@ class StockDatabase:
self.pendings = Pendings()
self.requests = Requests()
+ def begin(self):
+ """See `IDatabase`."""
+ # Storm takes care of this for us.
+ pass
+
+ def commit(self):
+ """See `IDatabase`."""
+ self.store.commit()
+
+ def abort(self):
+ """See `IDatabase`."""
+ self.store.rollback()
+
def _create(self, debug):
# Calculate the engine url.
url = Template(config.DEFAULT_DATABASE_URL).safe_substitute(
@@ -119,6 +135,7 @@ class StockDatabase:
self.store = store
def _reset(self):
+ """See `IDatabase`."""
from mailman.database.model import ModelMeta
self.store.rollback()
ModelMeta._reset(self.store)