Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
824dc122
Commit
824dc122
authored
Mar 12, 2004
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Checkpoint.
parent
357cc30d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
+16
-11
src/ZODB/tests/testmvcc.py
src/ZODB/tests/testmvcc.py
+16
-11
No files found.
src/ZODB/tests/testmvcc.py
View file @
824dc122
...
...
@@ -195,11 +195,12 @@ First get the database back in an initial state.
>>> r1["b"].value
0
>>> cn1.sync()
>>> r1["b"]._p_state
>>> cn1.sync()
# cn2 modified 'b', so cn1 should get a ghost for b
>>> r1["b"]._p_state
# -1 means GHOST
-1
Closing the connection and commit a transaction should have the same effect.
Closing the connection, committing a transaction, and aborting a transaction,
should all have the same effect on non-current objects in cache.
>>> def testit():
... cn1.sync()
...
...
@@ -211,6 +212,10 @@ Closing the connection and commit a transaction should have the same effect.
... cn2.getTransaction().commit()
>>> testit()
>>> r1["b"]._p_state # 0 means UPTODATE, although note it's an older revision
0
>>> r1["b"].value
0
>>> r1["a"].value = 1
>>> cn1.getTransaction().commit()
>>> r1["b"]._p_state
...
...
@@ -225,20 +230,20 @@ reused by the next open() call (along with its object cache).
>>> cn3 = db.open()
>>> cn1 is cn3
True
>>> cn1 = cn3
>>> r1 = cn1.root()
It's not just that every object is a ghost. The root was in the
cache, so our first reference to it doesn't return a ghost.
Although "b" is a ghost in cn1 at this point (because closing a connection
has the same effect on non-current objects in the connection's cache as
committing a transaction), not every object is a ghost. The root was in
the cache and was current, so our first reference to it doesn't return
a ghost.
>>> r1._p_state
>>> r1._p_state
# UPTODATE
0
>>> r1["b"]._p_state
>>> r1["b"]._p_state
# GHOST
-1
>>> cn1._transaction = None
(See the Cleanup section below.)
>>> cn1._transaction = None # See the Cleanup section below
Late invalidation
-----------------
...
...
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