[Zodb-checkins] CVS: ZODB4/src/zodb/storage - base.py:1.13.4.4

Barry Warsaw barry@wooz.org
Wed, 12 Mar 2003 16:40:26 -0500


Update of /cvs-repository/ZODB4/src/zodb/storage
In directory cvs.zope.org:/tmp/cvs-serv28976

Modified Files:
      Tag: opaque-pickles-branch
	base.py 
Log Message:
Resolve conflicts from HEAD merge


=== ZODB4/src/zodb/storage/base.py 1.13.4.3 => 1.13.4.4 ===
--- ZODB4/src/zodb/storage/base.py:1.13.4.3	Wed Mar 12 12:26:05 2003
+++ ZODB4/src/zodb/storage/base.py	Wed Mar 12 16:40:15 2003
@@ -44,7 +44,8 @@
 from zodb.storage.interfaces import StorageTransactionError, ReadOnlyError
 # BaseStorage provides primitives for lock acquisition and release, and a host
 # of other methods, some of which are overridden here, some of which are not.
-from zodb.lockfile import lock_file
+from zodb.lockfile import LockFile
+from zodb.serialize import findrefs
 
 GBYTES = 1024 * 1024 * 1000
 JOIN_TIME = 10
@@ -89,9 +90,6 @@
             raise StorageTransactionError(self, transaction)
         return []
 
-    def close(self):
-        pass
-
     def sortKey(self):
         # An implementation should override this if it can be shared
         # by multiple processes and / or guarantee that self._name is
@@ -706,10 +704,8 @@
         # can't hurt and is more robust.
         self._env.txn_checkpoint(0, 0, db.DB_FORCE)
         self._env.txn_checkpoint(0, 0, db.DB_FORCE)
-        lockfile = os.path.join(self._env.db_home, '.lock')
         self._lockfile.close()
         self._env.close()
-        os.unlink(lockfile)
 
     # A couple of convenience methods
     def _update(self, deltas, references, incdec):
@@ -771,15 +767,7 @@
     # This is required in order to work around the Berkeley lock
     # exhaustion problem (i.e. we do our own application level locks
     # rather than rely on Berkeley's finite page locks).
-    lockpath = os.path.join(envdir, '.lock')
-    try:
-        lockfile = open(lockpath, 'r+')
-    except IOError, e:
-        if e.errno <> errno.ENOENT: raise
-        lockfile = open(lockpath, 'w+')
-    lock_file(lockfile)
-    lockfile.write(str(os.getpid()))
-    lockfile.flush()
+    lockfile = LockFile(os.path.join(envdir, '.lock'))
     try:
         # Create, initialize, and open the environment
         env = db.DBEnv()