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
edaf43c4
Commit
edaf43c4
authored
Mar 12, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
2c4cbbd5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
12 deletions
+30
-12
bigfile/file_zodb.py
bigfile/file_zodb.py
+1
-1
lib/tests/test_zodb.py
lib/tests/test_zodb.py
+29
-11
No files found.
bigfile/file_zodb.py
View file @
edaf43c4
...
...
@@ -804,7 +804,7 @@ class _ZBigFileH(object):
#
# the reason we do it here, is that if we don't and Connection was not
# yet joined to transaction (i.e. no changes were made to Connection's
# objects), as storeblk() running inside commit will case changes to
# objects), as storeblk() running inside commit will ca
u
se changes to
# ZODB objects, zconn will want to join transaction, and that is
# currently forbidden.
#
...
...
lib/tests/test_zodb.py
View file @
edaf43c4
...
...
@@ -250,39 +250,57 @@ def test_zconn_at():
conn1
=
db
.
open
()
assert
zconn_at
(
conn1
)
==
at0
# open another simultaneous connection
conn2
=
db
.
open
()
assert
zconn_at
(
conn2
)
==
at0
# commit
root1
=
conn1
.
root
()
root1
[
'z'
]
=
1
transaction
.
commit
()
# after commit conn
ection view is updated
# after commit conn
1 view is updated; conn2 view stays @at0
zsync
(
stor
)
at1
=
stor
.
lastTransaction
()
assert
zconn_at
(
conn1
)
==
at1
assert
zconn_at
(
conn2
)
==
at0
# reopen -> view @at1
# reopen
conn1
-> view @at1
conn1
.
close
()
with
raises
(
POSException
.
ConnectionStateError
):
zconn_at
(
conn1
)
conn2
=
db
.
open
()
assert
conn2
is
conn1
# returned from DB pool
assert
zconn_at
(
conn2
)
==
at1
conn2
.
close
()
assert
zconn_at
(
conn2
)
==
at0
conn1_
=
db
.
open
()
assert
conn1_
is
conn1
# returned from DB pool
assert
zconn_at
(
conn1
)
==
at1
assert
zconn_at
(
conn2
)
==
at0
conn1
.
close
()
# commit empty transaction - view stays in sync with storage head
#
# TODO zconn_at after empty commit (with fs1 currently gives future tid,
# but db is not updated and wcfs client resync to that future tid hangs)
conn3
=
db
.
open
()
assert
conn3
is
conn2
# from DB pool
assert
zconn_at
(
conn3
)
==
at1
conn1_
=
db
.
open
()
assert
conn1_
is
conn2
# from DB pool
assert
zconn_at
(
conn1
)
==
at1
assert
zconn_at
(
conn2
)
==
at0
transaction
.
commit
()
zsync
(
stor
)
at1_
=
stor
.
lastTransaction
()
assert
zconn_at
(
conn3
)
==
at1_
assert
zconn_at
(
conn1
)
==
at1_
assert
zconn_at
(
conn2
)
==
at0
# reopen conn2 -> view upated to @at1_
conn2
.
close
()
conn2_
=
db
.
open
()
assert
conn2_
is
conn2
# from DB pool
assert
zconn_at
(
conn1
)
==
at1_
assert
zconn_at
(
conn2
)
==
at1_
conn3
.
close
()
conn1
.
close
()
conn2
.
close
()
# TODO commit -> know head -> open conn1,
...
...
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