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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
33203331
Commit
33203331
authored
Apr 15, 2004
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use an explicit transaction manager instead of setLocalTransaction().
parent
5d014c8f
Changes
1
Show 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 @
33203331
...
@@ -259,23 +259,23 @@ class ZODBTests(unittest.TestCase):
...
@@ -259,23 +259,23 @@ class ZODBTests(unittest.TestCase):
# error because the object state read is not necessarily
# error because the object state read is not necessarily
# consistent with the objects read earlier in the transaction.
# consistent with the objects read earlier in the transaction.
conn
=
self
.
_db
.
open
(
mvcc
=
False
)
tm1
=
transaction
.
TransactionManager
(
)
conn
.
setLocalTransaction
(
)
conn
=
self
.
_db
.
open
(
mvcc
=
False
,
txn_mgr
=
tm1
)
r1
=
conn
.
root
()
r1
=
conn
.
root
()
r1
[
"p"
]
=
self
.
obj
r1
[
"p"
]
=
self
.
obj
self
.
obj
.
child1
=
P
()
self
.
obj
.
child1
=
P
()
conn
.
getTransaction
().
commit
()
tm1
.
get
().
commit
()
# start a new transaction with a new connection
# start a new transaction with a new connection
cn2
=
self
.
_db
.
open
(
mvcc
=
False
)
tm2
=
transaction
.
TransactionManager
()
cn2
=
self
.
_db
.
open
(
mvcc
=
False
,
txn_mgr
=
tm2
)
# start a new transaction with the other connection
# start a new transaction with the other connection
cn2
.
setLocalTransaction
()
r2
=
cn2
.
root
()
r2
=
cn2
.
root
()
self
.
assertEqual
(
r1
.
_p_serial
,
r2
.
_p_serial
)
self
.
assertEqual
(
r1
.
_p_serial
,
r2
.
_p_serial
)
self
.
obj
.
child2
=
P
()
self
.
obj
.
child2
=
P
()
conn
.
getTransaction
().
commit
()
tm1
.
get
().
commit
()
# resume the transaction using cn2
# resume the transaction using cn2
obj
=
r2
[
"p"
]
obj
=
r2
[
"p"
]
...
@@ -287,7 +287,7 @@ class ZODBTests(unittest.TestCase):
...
@@ -287,7 +287,7 @@ class ZODBTests(unittest.TestCase):
else
:
else
:
# make sure that accessing the object succeeds
# make sure that accessing the object succeeds
obj
.
child1
obj
.
child1
cn2
.
getTransaction
().
abort
()
tm2
.
get
().
abort
()
def
checkReadConflictIgnored
(
self
):
def
checkReadConflictIgnored
(
self
):
# Test that an application that catches a read conflict and
# Test that an application that catches a read conflict and
...
@@ -303,8 +303,8 @@ class ZODBTests(unittest.TestCase):
...
@@ -303,8 +303,8 @@ class ZODBTests(unittest.TestCase):
get_transaction
().
commit
()
get_transaction
().
commit
()
# load some objects from one connection
# load some objects from one connection
cn2
=
self
.
_db
.
open
(
mvcc
=
False
)
tm
=
transaction
.
TransactionManager
(
)
cn2
.
setLocalTransaction
(
)
cn2
=
self
.
_db
.
open
(
mvcc
=
False
,
txn_mgr
=
tm
)
r2
=
cn2
.
root
()
r2
=
cn2
.
root
()
real_data2
=
r2
[
"real_data"
]
real_data2
=
r2
[
"real_data"
]
index2
=
r2
[
"index"
]
index2
=
r2
[
"index"
]
...
@@ -331,7 +331,7 @@ class ZODBTests(unittest.TestCase):
...
@@ -331,7 +331,7 @@ class ZODBTests(unittest.TestCase):
self
.
assert_
(
not
index2
[
0
].
_p_changed
)
self
.
assert_
(
not
index2
[
0
].
_p_changed
)
self
.
assert_
(
not
index2
[
1
].
_p_changed
)
self
.
assert_
(
not
index2
[
1
].
_p_changed
)
self
.
assertRaises
(
ConflictError
,
cn2
.
getTransaction
().
commit
)
self
.
assertRaises
(
ConflictError
,
tm
.
get
().
commit
)
get_transaction
().
abort
()
get_transaction
().
abort
()
def
checkIndependent
(
self
):
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