[Zope3-checkins] CVS: ZODB/src/ZODB - ZApplication.py:1.14

Jeremy Hylton jeremy at zope.com
Fri Apr 16 10:37:07 EDT 2004


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

Modified Files:
	ZApplication.py 
Log Message:
Use transaction.get() instead of getTransaction().
Replace use of type('') with basestring.

The code didn't call setLocalTransaction(), so getTransaction() always
did the same thing as transaction.get().


=== ZODB/src/ZODB/ZApplication.py 1.13 => 1.14 ===
--- ZODB/src/ZODB/ZApplication.py:1.13	Tue Apr  8 14:48:22 2003
+++ ZODB/src/ZODB/ZApplication.py	Fri Apr 16 10:37:02 2004
@@ -18,7 +18,8 @@
 """
 __version__='$Revision$'[11:-2]
 
-StringType=type('')
+import transaction
+
 connection_open_hooks = []
 
 class ZApplicationWrapper:
@@ -31,7 +32,7 @@
             root=conn.root()
             if not root.has_key(name):
                 root[name]=klass()
-                conn.getTransaction().commit()
+                transaction.commit()
             conn.close()
             self._klass=klass
 
@@ -74,7 +75,7 @@
 
         if connection is None:
             connection=db.open()
-        elif type(connection) is StringType:
+        elif isinstance(type, basestring):
             connection=db.open(connection)
 
         return connection.root()[aname]




More information about the Zope3-Checkins mailing list