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
nexedi
ZODB
Commits
b196e7d1
Commit
b196e7d1
authored
May 08, 2003
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix checkReadConflict() and enable it.
parent
51021fcf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
src/ZODB/tests/testZODB.py
src/ZODB/tests/testZODB.py
+10
-10
No files found.
src/ZODB/tests/testZODB.py
View file @
b196e7d1
...
...
@@ -18,7 +18,7 @@ import unittest
import
ZODB
import
ZODB.FileStorage
from
ZODB.PersistentMapping
import
PersistentMapping
from
ZODB.POSException
import
ReadConflictError
from
ZODB.POSException
import
ReadConflictError
,
ConflictError
from
ZODB.tests.StorageTestBase
import
removefs
from
Persistence
import
Persistent
...
...
@@ -229,17 +229,17 @@ class ZODBTests(unittest.TestCase):
obj
.
child1
cn2
.
getTransaction
().
abort
()
def
test
ReadConflictIgnored
(
self
):
def
check
ReadConflictIgnored
(
self
):
# Test that an application that catches a read conflict and
# continues can not commit the transaction later.
root
=
self
.
_db
.
open
().
root
()
root
[
"real_data"
]
=
real_data
=
Persistent
Dict
()
root
[
"index"
]
=
index
=
Persistent
Dict
()
root
[
"real_data"
]
=
real_data
=
Persistent
Mapping
()
root
[
"index"
]
=
index
=
Persistent
Mapping
()
real_data
[
"a"
]
=
Persistent
Dict
({
"indexed_value"
:
0
})
real_data
[
"b"
]
=
Persistent
Dict
({
"indexed_value"
:
1
})
index
[
1
]
=
Persistent
Dict
({
"b"
:
1
})
index
[
0
]
=
Persistent
Dict
({
"a"
:
1
})
real_data
[
"a"
]
=
Persistent
Mapping
({
"indexed_value"
:
0
})
real_data
[
"b"
]
=
Persistent
Mapping
({
"indexed_value"
:
1
})
index
[
1
]
=
Persistent
Mapping
({
"b"
:
1
})
index
[
0
]
=
Persistent
Mapping
({
"a"
:
1
})
get_transaction
().
commit
()
# load some objects from one connection
...
...
@@ -252,7 +252,7 @@ class ZODBTests(unittest.TestCase):
real_data
[
"b"
][
"indexed_value"
]
=
0
del
index
[
1
][
"b"
]
index
[
0
][
"b"
]
=
1
cn2
.
getT
ransaction
().
commit
()
get_t
ransaction
().
commit
()
del
real_data2
[
"a"
]
try
:
...
...
@@ -271,7 +271,7 @@ class ZODBTests(unittest.TestCase):
self
.
assert_
(
not
index2
[
0
].
_p_changed
)
self
.
assert_
(
not
index2
[
1
].
_p_changed
)
self
.
assertRaises
(
ConflictError
,
get_t
ransaction
().
commit
)
self
.
assertRaises
(
ConflictError
,
cn2
.
getT
ransaction
().
commit
)
get_transaction
().
abort
()
def
checkIndependent
(
self
):
...
...
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