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
27c1870a
Commit
27c1870a
authored
Apr 01, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
81f819e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
4 deletions
+45
-4
bigfile/_file_zodb.pyx
bigfile/_file_zodb.pyx
+5
-4
lib/tests/test_zodb.py
lib/tests/test_zodb.py
+40
-0
No files found.
bigfile/_file_zodb.pyx
View file @
27c1870a
...
...
@@ -58,8 +58,8 @@ from wendelin.lib.zodb import zconn_at
# _ZBigFile is base class for ZBigFile that provides BigFile-line base.
#
# The other base line is from Persistent. It is not possible to inherit from
# both Persistent and BigFile at the same time since both
types are C types and
#
their
layouts conflict.
# both Persistent and BigFile at the same time since both
are C types and their
# layouts conflict.
#
# _ZBigFile:
#
...
...
@@ -141,8 +141,9 @@ cdef wcfs.PyConn pywconnOf(zconn):
# ZSync keeps wconn in sync with zconn.
# XXX -> make generic and usefor _ZBigFileH too?
# XXX naming?
# XXX -> make generic and use for _ZBigFileH too?
# -> y: ZSync base + ZSyncWConn, ZSyncBigFileH
# XXX naming? -> ZKeepInSync ?
class
ZSync
:
# .zconn
# .wconn
...
...
lib/tests/test_zodb.py
View file @
27c1870a
...
...
@@ -305,6 +305,46 @@ def test_zconn_at():
assert
zconn_at
(
conn_at0
)
==
at0
# verify that ZODB.Connection.onResyncCallback works
@
func
def
test_zodb_onresync
():
stor
=
testdb
.
getZODBStorage
()
defer
(
stor
.
close
)
db
=
DB
(
stor
)
class
T
:
def
__init__
(
t
):
t
.
nresync
=
0
def
on_connection_resync
(
t
):
t
.
nresync
+=
1
t
=
T
()
conn
=
db
.
open
()
conn
.
onResyncCallback
(
t
)
assert
t
.
nresync
==
0
# abort makes conn to enter new transaction
transaction
.
abort
()
assert
t
.
nresync
==
1
# close/reopen -> new transaction
conn
.
close
()
assert
t
.
nresync
==
1
conn_
=
db
.
open
()
assert
conn_
is
conn
assert
t
.
nresync
==
2
# commit -> new transaction
root
=
conn
.
root
()
root
[
'r'
]
=
1
assert
t
.
nresync
==
2
transaction
.
commit
()
assert
t
.
nresync
==
3
conn
.
close
()
# ---- misc ----
# zsync syncs ZODB storage.
...
...
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