[Zodb-checkins] CVS: ZODB/src/scripts - zodbload.py:1.6 zeoup.py:1.17

Jeremy Hylton jeremy at zope.com
Fri Apr 16 11:58:41 EDT 2004


Update of /cvs-repository/ZODB/src/scripts
In directory cvs.zope.org:/tmp/cvs-serv11088/src/scripts

Modified Files:
	zodbload.py zeoup.py 
Log Message:
Replace use of builtin get_transaction() with explicit transaction module.


=== ZODB/src/scripts/zodbload.py 1.5 => 1.6 ===
--- ZODB/src/scripts/zodbload.py:1.5	Thu Mar 18 08:27:49 2004
+++ ZODB/src/scripts/zodbload.py	Fri Apr 16 11:58:10 2004
@@ -217,7 +217,7 @@
 
     app.cat.addIndex('PrincipiaSearchSource', 'ZCTextIndex', extra)
 
-    get_transaction().commit()
+    transaction.commit()
 
     system = AccessControl.SpecialUsers.system
     AccessControl.SecurityManagement.newSecurityManager(None, system)
@@ -237,7 +237,7 @@
     while 1:
         connection = db.open()
         try:
-            get_transaction().begin()
+            transaction.begin()
             t=time.time()
             c=time.clock()
             try:
@@ -245,7 +245,7 @@
                     r = f(connection, *args)
                 except ConflictError:
                     rconflicts += 1
-                    get_transaction().abort()
+                    transaction.abort()
                     continue
             finally:
                 wcomp += time.time() - t
@@ -255,11 +255,11 @@
             c=time.clock()
             try:
                 try:
-                    get_transaction().commit()
+                    transaction.commit()
                     break
                 except ConflictError:
                     wconflicts += 1
-                    get_transaction().abort()
+                    transaction.abort()
                     continue
             finally:
                 wcommit += time.time() - t


=== ZODB/src/scripts/zeoup.py 1.16 => 1.17 ===
--- ZODB/src/scripts/zeoup.py:1.16	Thu Mar 18 08:27:49 2004
+++ ZODB/src/scripts/zeoup.py	Fri Apr 16 11:58:10 2004
@@ -66,7 +66,7 @@
                 monitor = root['monitor'] = PersistentMapping()
             obj = monitor['zeoup'] = monitor.get('zeoup', MinPO(0))
             obj.value += 1
-            get_transaction().commit()
+            transaction.commit()
         except ConflictError:
             pass
         cn.close()




More information about the Zodb-checkins mailing list