[Checkins] SVN: PluggableAuthService/trunk/ Made sure the Extensions.upgrade script does not commit full

Stefan H. Holek stefan at epy.co.at
Sun Mar 25 10:38:56 EDT 2007


Log message for revision 73608:
  Made sure the Extensions.upgrade script does not commit full
  transactions but only sets (optimistic) savepoints. Removed bogus
  Zope 2.7 compatibility in the process.
  (http://www.zope.org/Collectors/PAS/55)
  

Changed:
  U   PluggableAuthService/trunk/Extensions/upgrade.py
  U   PluggableAuthService/trunk/doc/CHANGES.txt

-=-
Modified: PluggableAuthService/trunk/Extensions/upgrade.py
===================================================================
--- PluggableAuthService/trunk/Extensions/upgrade.py	2007-03-25 14:34:54 UTC (rev 73607)
+++ PluggableAuthService/trunk/Extensions/upgrade.py	2007-03-25 14:38:56 UTC (rev 73608)
@@ -31,14 +31,8 @@
 $Id$
 """
 import logging
+import transaction
 
-try:
-    import transaction
-    get_transaction = transaction.get
-except ImportError:
-    # Zope 2.7 backwards compatibility
-    pass
-
 def _write(response, tool, message):
     logger = logging.getLogger('PluggableAuthService.upgrade.%s' % tool)
     logger.info(message)
@@ -115,7 +109,7 @@
               , 'replaceRootUserFolder'
               , 'Replaced root acl_users with PluggableAuthService\n' )
 
-    get_transaction().commit()
+    transaction().savepoint(True)
 
 def _migrate_user( pas, login, password, roles ):
 
@@ -177,10 +171,10 @@
                           , ( 'Local Roles map changed for (%s)\n'
                               % '/'.join(path) ) )
             if (len(seen) % 100 ) == 0:
-                get_transaction().commit()
+                transaction.savepoint(True)
                 _write( RESPONSE
                       , 'upgradeLocalRoleAssignmentsFromRoot'
-                      , "  -- committed at object # %d\n" % len( seen ) )
+                      , "  -- Set savepoint at object # %d\n" % len( seen ) )
             if getattr(aq_base(obj), 'isPrincipiaFolderish', 0):
                 for o in obj.objectValues():
                     descend(user_folder, o)
@@ -193,7 +187,7 @@
 
     descend(self.acl_users, self)
 
-    get_transaction().commit()
+    transaction.savepoint(True)
 
 # External Method to use
 

Modified: PluggableAuthService/trunk/doc/CHANGES.txt
===================================================================
--- PluggableAuthService/trunk/doc/CHANGES.txt	2007-03-25 14:34:54 UTC (rev 73607)
+++ PluggableAuthService/trunk/doc/CHANGES.txt	2007-03-25 14:38:56 UTC (rev 73608)
@@ -12,6 +12,11 @@
 
     Bugs Fixed
 
+      - Made sure the Extensions.upgrade script does not commit full
+        transactions but only sets (optimistic) savepoints. Removed bogus
+        Zope 2.7 compatibility in the process.
+        (http://www.zope.org/Collectors/PAS/55)
+
       - Made the CookieAuthHelper only use the '__ac_name' field if
         '__ac_password' is also present. This fixes a login problem for
         CMF sites where the login name was remembered between sessions with



More information about the Checkins mailing list