summaryrefslogtreecommitdiff
path: root/Mailman/database
diff options
context:
space:
mode:
authorbwarsaw2007-03-30 05:09:36 +0000
committerbwarsaw2007-03-30 05:09:36 +0000
commit0caacf05262875f4e1791fd88d45910ac66dfd74 (patch)
treee09cdfeec157ca5b8e4d5c8dbff7a9088d044799 /Mailman/database
parent92188309a4648d23abb97f8dd2c6c924d9ea24b1 (diff)
downloadmailman-0caacf05262875f4e1791fd88d45910ac66dfd74.tar.gz
mailman-0caacf05262875f4e1791fd88d45910ac66dfd74.tar.zst
mailman-0caacf05262875f4e1791fd88d45910ac66dfd74.zip
api_lock(): When locking the MailList object, tell the SQLAlchemy session to
expire the object. This way, when the MailList attributes are next accessed, the ORM will reload them from the database, getting any new values possibly set in other processes. This works better than trying to use always_refresh=True on the mapper, or trying to do a reload() because both of those approaches blow away locks. I'm not sure why this, but I suspect that it's because the identity map is handing us back a different object, rather than invalidating the object's attributes.
Diffstat (limited to 'Mailman/database')
-rw-r--r--Mailman/database/dbcontext.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Mailman/database/dbcontext.py b/Mailman/database/dbcontext.py
index 66c021447..306e0b2bb 100644
--- a/Mailman/database/dbcontext.py
+++ b/Mailman/database/dbcontext.py
@@ -129,6 +129,7 @@ class DBContext(object):
# Higher level interface
def api_lock(self, mlist):
+ self.session.expire(mlist)
# Don't try to re-lock a list
if mlist.fqdn_listname in self._mlist_txns:
return