[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mailman-cvs
Subject:    [Mailman-checkins] SF.net SVN: mailman: [8184] trunk/mailman/Mailman
From:       bwarsaw () users ! sourceforge ! net
Date:       2007-03-30 5:09:36
Message-ID: E1HX9Mm-0006k5-W8 () sc8-pr-svn1 ! sourceforge ! net
[Download RAW message or body]

Revision: 8184
          http://svn.sourceforge.net/mailman/?rev=8184&view=rev
Author:   bwarsaw
Date:     2007-03-29 22:09:36 -0700 (Thu, 29 Mar 2007)

Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/mailman/Mailman/database/dbcontext.py
    trunk/mailman/Mailman/testing/test_handlers.py

Modified: trunk/mailman/Mailman/database/dbcontext.py
===================================================================
--- trunk/mailman/Mailman/database/dbcontext.py	2007-03-27 06:35:12 UTC (rev 8183)
+++ trunk/mailman/Mailman/database/dbcontext.py	2007-03-30 05:09:36 UTC (rev 8184)
@@ -129,6 +129,7 @@
 
     # 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

Modified: trunk/mailman/Mailman/testing/test_handlers.py
===================================================================
--- trunk/mailman/Mailman/testing/test_handlers.py	2007-03-27 06:35:12 UTC (rev 8183)
+++ trunk/mailman/Mailman/testing/test_handlers.py	2007-03-30 05:09:36 UTC (rev 8184)
@@ -1802,7 +1802,6 @@
         eq(mimemsg['to'], mlist.GetListEmail())
         # BAW: this test is incomplete...
 
-
     def test_send_i18n_digest(self):
         eq = self.assertEqual
         mlist = self._mlist


This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site. _______________________________________________
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/mailman-cvs%40progressive-comp.com



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic