Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
31a75407
Commit
31a75407
authored
Apr 01, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
5be94d4d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
73 deletions
+39
-73
lib/zodb.py
lib/zodb.py
+39
-1
z.txt
z.txt
+0
-72
No files found.
lib/zodb.py
View file @
31a75407
...
...
@@ -146,6 +146,27 @@ def zconn_at(zconn): # -> tid
raise
POSException
.
ConnectionStateError
(
"database connection is closed"
)
# ZODB5 uses MVCC uniformly
#
# zconn.db._storage always provides IMVCCStorage - either raw storage provides it,
# or DB wraps raw storage with MVCCAdapter.
#
# MVCCAdapter in turn uses either MVCCAdapterInstance (current) or
# HistoricalStorageAdapter, or UndoAdapterInstance. Retriving zconn.at from those:
#
# MVCCAdapterInstance
# ._start
#
# HistoricalStorageAdapter
# ._before
#
# UndoAdapterInstance
# # no way to retrieve `at`, but .undo_instance() through which
# # UndoAdapterInstance is returnerd, is not used anywhere.
#
# For the reference: FileStorage, ZEO and NEO do not provide IMVCCStorage, thus
# for them we can rely on MVCCAdapterInstance.
#
# RelStorage is IMVCCStorage - TODO: how to extract at.
if
zmajor
>=
5
:
zstor
=
zconn
.
_storage
if
isinstance
(
zstor
,
ZODB
.
mvccadapter
.
MVCCAdapterInstance
):
...
...
@@ -156,7 +177,24 @@ def zconn_at(zconn): # -> tid
raise
AssertionError
(
"zconn_at: TODO: add support for zstor %r"
%
zstor
)
raise
AssertionError
(
"zconn_at: TODO: add support for ZODB34"
)
# ZODB4
#
# Connection:
# .before !None for historic connections
#
# ._txn_time - if !None - set to tid of _next_ transaction
# XXX set to None initially - what to do?
#
# # XXX do something like that ZODB5 is doing:
# zconn._start = zconn._storage.lastTransaction() + 1
# # XXX _and_ check out queued invalidations
elif
zmajor
==
4
:
raise
AssertionError
(
"zconn_at: TODO: add support for ZODB4"
)
# ZODB3
else
:
raise
AssertionError
(
"zconn_at: TODO: add support for ZODB3"
)
# before2at converts tid that specifies database state as "before" into tid that
...
...
z.txt
deleted
100644 → 0
View file @
5be94d4d
ZODB5
-----
zconn.db._storage always provides IMVCCStorage - either raw storage provides it,
or DB wraps raw storage with MVCCAdapter.
MVCCAdapter in turn uses either MVCCAdapterInstance (current) or
HistoricalStorageAdapter, or UndoAdapterInstance. Retriving zconn.at from those:
MVCCAdapterInstance
._start
HistoricalStorageAdapter
._before
UndoAdapterInstance
# no way to retrieve `at`, but .undo_instance() through which
# UndoAdapterInstance is returnerd, is not used anywhere.
For the reference: FileStorage, ZEO and NEO do not provide IMVCCStorage, thus
for them we can rely on MVCCAdapterInstance.
RelStorage is IMVCCStorage - TODO: how to extract at.
ZODB4
-----
Connection:
.before !None for historic connections
._txn_time - if !None - set to tid of _next_ transaction
XXX set to None initially - what to do?
# XXX do something like that ZODB5 is doing:
zconn._start = zconn._storage.lastTransaction() + 1
# XXX _and_ check out queued invalidations
ZODB3
-----
TODO
----------------------------------------
zconn._storage
DB.getTid(at, before)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment