Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Kirill Smelkov
ZEO
Commits
23e0b0c0
Commit
23e0b0c0
authored
Mar 12, 2004
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Checkpoint.
parent
a6ccd078
Changes
1
Hide 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 @
23e0b0c0
...
@@ -195,11 +195,12 @@ First get the database back in an initial state.
...
@@ -195,11 +195,12 @@ First get the database back in an initial state.
>>> r1["b"].value
>>> r1["b"].value
0
0
>>> cn1.sync()
>>> cn1.sync()
# cn2 modified 'b', so cn1 should get a ghost for b
>>> r1["b"]._p_state
>>> r1["b"]._p_state
# -1 means GHOST
-1
-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():
>>> def testit():
... cn1.sync()
... cn1.sync()
...
@@ -211,6 +212,10 @@ Closing the connection and commit a transaction should have the same effect.
...
@@ -211,6 +212,10 @@ Closing the connection and commit a transaction should have the same effect.
... cn2.getTransaction().commit()
... cn2.getTransaction().commit()
>>> testit()
>>> testit()
>>> r1["b"]._p_state # 0 means UPTODATE, although note it's an older revision
0
>>> r1["b"].value
0
>>> r1["a"].value = 1
>>> r1["a"].value = 1
>>> cn1.getTransaction().commit()
>>> cn1.getTransaction().commit()
>>> r1["b"]._p_state
>>> r1["b"]._p_state
...
@@ -225,20 +230,20 @@ reused by the next open() call (along with its object cache).
...
@@ -225,20 +230,20 @@ reused by the next open() call (along with its object cache).
>>> cn3 = db.open()
>>> cn3 = db.open()
>>> cn1 is cn3
>>> cn1 is cn3
True
True
>>> cn1 = cn3
>>> r1 = cn1.root()
>>> r1 = cn1.root()
It's not just that every object is a ghost. The root was in the
Although "b" is a ghost in cn1 at this point (because closing a connection
cache, so our first reference to it doesn't return a ghost.
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
0
>>> r1["b"]._p_state
>>> r1["b"]._p_state
# GHOST
-1
-1
>>> cn1._transaction = None
>>> cn1._transaction = None # See the Cleanup section below
(See the Cleanup section below.)
Late invalidation
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