Commit b8666c09 authored by Joshua Woelfel's avatar Joshua Woelfel

Fixed problem with initializing db's latest state field

parent 1c1688c0
......@@ -179,13 +179,8 @@ def zconn_at(zconn): # -> tid
raise AssertionError("zconn_at: TODO: add support for zstor %r" % zstor)
# ZODB3, ZODB4
#
# If historic connection, convert and return zconn.before. Otherwise
# returns tid of last transaction, if viewing latest db state, or if
# later db state exists, returns tid of db state previous to later
# state
else:
elif zmajor == 4:
if not zconn.before
zconn._inv_lock.acquire()
try:
viewed_state = zconn.viewed_db_state
......@@ -193,6 +188,10 @@ def zconn_at(zconn): # -> tid
zconn._inv_lock.release()
return viewed_state
# TODO ZODB3
else:
pass
# before2at converts tid that specifies database state as "before" into tid that
# specifies database state as "at".
def before2at(before): # -> at
......@@ -342,7 +341,9 @@ if zmajor == 4:
self.history(z64)
self._a()
try:
if self.latest_state is None:
# initialize latest_state with last_tid if not yet initialized
# during invalidation process
if not hasattr(self, 'latest_state'):
self.latest_state = last_tid
finally:
self._r()
......
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