[Zodb-checkins] CVS: ZODB3/bsddb3Storage/bsddb3Storage - BerkeleyBase.py:1.36

Barry Warsaw barry@wooz.org
Thu, 12 Dec 2002 13:48:00 -0500


Update of /cvs-repository/ZODB3/bsddb3Storage/bsddb3Storage
In directory cvs.zope.org:/tmp/cvs-serv19746

Modified Files:
	BerkeleyBase.py 
Log Message:
cleanup(): We can't get the db_home from the environment object after
the environment has been closed.  Fortunately, there's another way.

Add some more logging.


=== ZODB3/bsddb3Storage/bsddb3Storage/BerkeleyBase.py 1.35 => 1.36 ===
--- ZODB3/bsddb3Storage/bsddb3Storage/BerkeleyBase.py:1.35	Tue Dec 10 17:39:57 2002
+++ ZODB3/bsddb3Storage/bsddb3Storage/BerkeleyBase.py	Thu Dec 12 13:48:00 2002
@@ -195,6 +195,7 @@
         if env is None:
             env = name
 
+        self.log('Creating Berkeley environment')
         if env == '':
             raise TypeError, 'environment name is empty'
         elif isinstance(env, StringType):
@@ -206,6 +207,7 @@
         # This should be enough of a guarantee that sortKey() -- which via
         # BaseStorage uses the name -- is globally unique.
         envdir = os.path.abspath(self._env.db_home)
+        self.log('Berkeley environment dir: %s', envdir)
         BaseStorage.__init__(self, envdir)
         self._is_read_only = config.read_only
 
@@ -221,6 +223,7 @@
         # Initialize the object id counter.
         self._init_oid()
         # Set up the checkpointing thread
+        self.log('setting up threads')
         if config.interval > 0:
             self._checkpointstop = event = threading.Event()
             self._checkpointer = _Checkpoint(self, event, config.interval)
@@ -234,6 +237,7 @@
             self._autopacker.start()
         else:
             self._autopacker = None
+        self.log('ready')
 
     def _make_autopacker(self, event):
         raise NotImplementedError
@@ -376,6 +380,7 @@
                 self._closed = True
         finally:
             self._lock_release()
+        self.log('finished closing the database')
 
     def _doclose(self):
         # Close all the tables
@@ -441,7 +446,7 @@
 
     def cleanup(self):
         """Remove the entire environment directory for this storage."""
-        cleanup(self._env.db_home)
+        cleanup(self.getName())