[Zope-Checkins] SVN: Zope/trunk/lib/python/App/FactoryDispatcher.py Now closing manually opened zodb connections -- thanks Stefan

Rocky Burt rocky at serverzen.com
Thu May 4 11:35:45 EDT 2006


Log message for revision 67964:
  Now closing manually opened zodb connections -- thanks Stefan

Changed:
  U   Zope/trunk/lib/python/App/FactoryDispatcher.py

-=-
Modified: Zope/trunk/lib/python/App/FactoryDispatcher.py
===================================================================
--- Zope/trunk/lib/python/App/FactoryDispatcher.py	2006-05-04 13:44:32 UTC (rev 67963)
+++ Zope/trunk/lib/python/App/FactoryDispatcher.py	2006-05-04 15:35:44 UTC (rev 67964)
@@ -33,13 +33,18 @@
             old_product_packages[x] = m
     
     packages = {}
-    products = Zope2.app().Control_Panel.Products
-    for product_id in products.objectIds():
-        product = products[product_id]
-        if hasattr(product, 'package_name'):
-            packages[product_id] = __import__(product.package_name)
-        elif old_product_packages.has_key(product_id):
-            packages[product_id] = old_product_packages[product_id]
+    app = Zope2.app()
+    try:
+        products = app.Control_Panel.Products
+        
+        for product_id in products.objectIds():
+            product = products[product_id]
+            if hasattr(product, 'package_name'):
+                packages[product_id] = __import__(product.package_name)
+            elif old_product_packages.has_key(product_id):
+                packages[product_id] = old_product_packages[product_id]
+    finally:
+        app._p_jar.close()
     
     return packages
 



More information about the Zope-Checkins mailing list