[BUG] Zope does not close its database on shutdown (was: [Zope-dev] close() in ZODB)

2005-07-26 Thread Dieter Maurer
[EMAIL PROTECTED] wrote at 2005-7-26 11:40 +0200:
>I'm currently hacking the ZODB, and I've found that the close() method in DB.py
>which call close() on FileStorage is never called.
>Is this a bug ?

Yes, looks like a bug

As a consequence, the index file of "ZODB.FileStorage.FileStorage"'s
is not rebuilt.


Please file a bug report.


The attached patch solves the problem.

-- 
Dieter

--- Zope/Startup/__init__.py~	2005-04-05 07:47:31.0 +0200
+++ Zope/Startup/__init__.py	2005-07-26 19:21:15.0 +0200
@@ -70,6 +70,10 @@
  'Shutting down with exit code %s' % ZServer.exit_code)
 sys.exit(ZServer.exit_code)
 finally:
+# DM 2005-07-26: close the DB to let (e.g.) "FileStorage"s
+#  cleanup correctly
+from Globals import DB
+if DB is not None: DB.close()
 starter.unlinkLockFile()
 starter.unlinkPidFile()
 started = False
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] close() in ZODB

2005-07-26 Thread aurelcalonne
Hello,

I'm currently hacking the ZODB, and I've found that the close() method in DB.py
which call close() on FileStorage is never called.
Is this a bug ?

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )