[Zodb-checkins] CVS: ZODB3/bsddb3Storage/bsddb3Storage - BerkeleyBase.py:1.19.2.4
Barry Warsaw
barry@wooz.org
Tue, 22 Oct 2002 19:07:09 -0400
Update of /cvs-repository/ZODB3/bsddb3Storage/bsddb3Storage
In directory cvs.zope.org:/tmp/cvs-serv21363
Modified Files:
Tag: bdb-nolocks
BerkeleyBase.py
Log Message:
Move _withlock() from Full to BerkeleyBase.
close(): Rearrange the order of closing the environment and the lock
file. Also, get rid of _closelog() since there isn't a commit log
anymore.
=== ZODB3/bsddb3Storage/bsddb3Storage/BerkeleyBase.py 1.19.2.3 => 1.19.2.4 ===
--- ZODB3/bsddb3Storage/bsddb3Storage/BerkeleyBase.py:1.19.2.3 Thu Sep 19 18:09:34 2002
+++ ZODB3/bsddb3Storage/bsddb3Storage/BerkeleyBase.py Tue Oct 22 19:07:09 2002
@@ -28,6 +28,7 @@
from ZODB import POSException
from ZODB.lock_file import lock_file
from ZODB.BaseStorage import BaseStorage
+from ZODB.referencesf import referencesf
GBYTES = 1024 * 1024 * 1000
@@ -257,10 +258,9 @@
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._env.close()
self._lockfile.close()
+ self._env.close()
os.unlink(lockfile)
- self._closelog()
def _docheckpoint(self):
# Periodically checkpoint the database. This is called approximately
@@ -281,6 +281,13 @@
del deltas[oid]
else:
deltas[oid] = rc
+
+ def _withlock(self, meth, *args):
+ self._lock_acquire()
+ try:
+ return meth(*args)
+ finally:
+ self._lock_release()