Commit 62c36ef8 authored by Barry Warsaw's avatar Barry Warsaw

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.
parent 46815aff
...@@ -25,7 +25,7 @@ from bsddb3 import db ...@@ -25,7 +25,7 @@ from bsddb3 import db
from ZODB import POSException from ZODB import POSException
from ZODB.BaseStorage import BaseStorage from ZODB.BaseStorage import BaseStorage
# $Revision: 1.5 $ # $Revision: 1.6 $
__version__ = '0.1' __version__ = '0.1'
...@@ -148,6 +148,18 @@ class BerkeleyBase(BaseStorage): ...@@ -148,6 +148,18 @@ class BerkeleyBase(BaseStorage):
# TBD: this is expensive to calculate and many not be necessary. # TBD: this is expensive to calculate and many not be necessary.
return 0 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): def _vote(self):
# Make a promise to commit all the registered changes. Rewind and put # Make a promise to commit all the registered changes. Rewind and put
# our commit log in the PROMISED state. # our commit log in the PROMISED state.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment