[Zodb-checkins] CVS: Packages/bsddb3Storage - BerkeleyBase.py:1.6
barry@digicool.com
barry@digicool.com
Mon, 23 Apr 2001 23:44:59 -0400 (EDT)
Update of /cvs-repository/Packages/bsddb3Storage
In directory korak:/tmp/cvs-serv5947
Modified Files:
BerkeleyBase.py
Log Message:
tpc_vote(): For the benefit of Zope distros 2.3.1 or earlier, we need
to override BaseStorage's tpc_vote(). This isn't necessary for any
subsequent Zope distributions, because BaseStorage has grown an
identical tpc_vote.
--- Updated File BerkeleyBase.py in package Packages/bsddb3Storage --
--- BerkeleyBase.py 2001/04/13 19:18:16 1.5
+++ BerkeleyBase.py 2001/04/24 03:44:58 1.6
@@ -148,6 +148,18 @@
# TBD: this is expensive to calculate and many not be necessary.
return 0
+ # BAW: this overrides BaseStorage.tpc_vote() with exactly the same
+ # implementation. This is so Zope 2.3.1, which doesn't include the change
+ # to BaseStorage, will work with Berkeley. Once we can ignore older
+ # versions of ZODB, we can get rid of this.
+ def tpc_vote(self, transaction):
+ self._lock_acquire()
+ try:
+ if transaction is not self._transaction: return
+ self._vote()
+ finally:
+ self._lock_release()
+
def _vote(self):
# Make a promise to commit all the registered changes. Rewind and put
# our commit log in the PROMISED state.
--- Updated File BerkeleyBase.py in package Packages/bsddb3Storage --
--- BerkeleyBase.py 2001/04/13 19:18:16 1.5
+++ BerkeleyBase.py 2001/04/24 03:44:58 1.6
@@ -148,6 +148,18 @@
# TBD: this is expensive to calculate and many not be necessary.
return 0
+ # BAW: this overrides BaseStorage.tpc_vote() with exactly the same
+ # implementation. This is so Zope 2.3.1, which doesn't include the change
+ # to BaseStorage, will work with Berkeley. Once we can ignore older
+ # versions of ZODB, we can get rid of this.
+ def tpc_vote(self, transaction):
+ self._lock_acquire()
+ try:
+ if transaction is not self._transaction: return
+ self._vote()
+ finally:
+ self._lock_release()
+
def _vote(self):
# Make a promise to commit all the registered changes. Rewind and put
# our commit log in the PROMISED state.