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
d268d538
Commit
d268d538
authored
Nov 27, 2016
by
Jim Fulton
Committed by
GitHub
Nov 27, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #134 from zopefoundation/transaction-203
Fixed to work with transaction 2.0.3.
parents
977e24bf
9a348a89
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
47 additions
and
45 deletions
+47
-45
CHANGES.rst
CHANGES.rst
+2
-0
src/ZODB/DB.py
src/ZODB/DB.py
+1
-1
src/ZODB/tests/BasicStorage.py
src/ZODB/tests/BasicStorage.py
+1
-1
src/ZODB/tests/PackableStorage.py
src/ZODB/tests/PackableStorage.py
+5
-5
src/ZODB/tests/RecoveryStorage.py
src/ZODB/tests/RecoveryStorage.py
+3
-3
src/ZODB/tests/RevisionStorage.py
src/ZODB/tests/RevisionStorage.py
+1
-1
src/ZODB/tests/StorageTestBase.py
src/ZODB/tests/StorageTestBase.py
+1
-1
src/ZODB/tests/TransactionalUndoStorage.py
src/ZODB/tests/TransactionalUndoStorage.py
+17
-17
src/ZODB/tests/dangle.py
src/ZODB/tests/dangle.py
+5
-5
src/ZODB/tests/testConnection.py
src/ZODB/tests/testConnection.py
+1
-1
src/ZODB/tests/testFileStorage.py
src/ZODB/tests/testFileStorage.py
+1
-1
src/ZODB/tests/testMVCCMappingStorage.py
src/ZODB/tests/testMVCCMappingStorage.py
+2
-2
src/ZODB/tests/testZODB.py
src/ZODB/tests/testZODB.py
+4
-4
src/ZODB/tests/test_fsdump.py
src/ZODB/tests/test_fsdump.py
+1
-1
src/ZODB/tests/testfsoids.py
src/ZODB/tests/testfsoids.py
+2
-2
No files found.
CHANGES.rst
View file @
d268d538
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
4.4.4 (unreleased)
4.4.4 (unreleased)
==================
==================
- Fixed to work with transaction 2.0.3.
- Call _p_resolveConflict() even if a conflicting change doesn't change the
- Call _p_resolveConflict() even if a conflicting change doesn't change the
state. This reverts to the behaviour of 3.10.3 and older.
state. This reverts to the behaviour of 3.10.3 and older.
...
...
src/ZODB/DB.py
View file @
d268d538
...
@@ -452,7 +452,7 @@ class DB(object):
...
@@ -452,7 +452,7 @@ class DB(object):
p
.
dump
((
root
.
__class__
,
None
))
p
.
dump
((
root
.
__class__
,
None
))
p
.
dump
(
root
.
__getstate__
())
p
.
dump
(
root
.
__getstate__
())
t
=
transaction
.
Transaction
()
t
=
transaction
.
Transaction
()
t
.
description
=
'initial database creation'
t
.
description
=
u
'initial database creation'
temp_storage
.
tpc_begin
(
t
)
temp_storage
.
tpc_begin
(
t
)
temp_storage
.
store
(
z64
,
None
,
file
.
getvalue
(),
''
,
t
)
temp_storage
.
store
(
z64
,
None
,
file
.
getvalue
(),
''
,
t
)
temp_storage
.
tpc_vote
(
t
)
temp_storage
.
tpc_vote
(
t
)
...
...
src/ZODB/tests/BasicStorage.py
View file @
d268d538
...
@@ -184,7 +184,7 @@ class BasicStorage:
...
@@ -184,7 +184,7 @@ class BasicStorage:
oid
=
self
.
_storage
.
new_oid
()
oid
=
self
.
_storage
.
new_oid
()
t
=
transaction
.
Transaction
()
t
=
transaction
.
Transaction
()
self
.
_storage
.
tpc_begin
(
t
)
self
.
_storage
.
tpc_begin
(
t
)
t
.
note
(
'this is a test'
)
t
.
note
(
u
'this is a test'
)
self
.
_storage
.
store
(
oid
,
ZERO
,
zodb_pickle
(
MinPO
(
5
)),
''
,
t
)
self
.
_storage
.
store
(
oid
,
ZERO
,
zodb_pickle
(
MinPO
(
5
)),
''
,
t
)
self
.
_storage
.
tpc_vote
(
t
)
self
.
_storage
.
tpc_vote
(
t
)
self
.
_storage
.
tpc_finish
(
t
)
self
.
_storage
.
tpc_finish
(
t
)
...
...
src/ZODB/tests/PackableStorage.py
View file @
d268d538
...
@@ -148,7 +148,7 @@ class PackableStorageBase:
...
@@ -148,7 +148,7 @@ class PackableStorageBase:
p
.
dump
((
PersistentMapping
,
None
))
p
.
dump
((
PersistentMapping
,
None
))
p
.
dump
({
'_container'
:
{}})
p
.
dump
({
'_container'
:
{}})
t
=
Transaction
()
t
=
Transaction
()
t
.
description
=
'initial database creation'
t
.
description
=
u
'initial database creation'
self
.
_storage
.
tpc_begin
(
t
)
self
.
_storage
.
tpc_begin
(
t
)
self
.
_storage
.
store
(
ZERO
,
None
,
file
.
getvalue
(),
''
,
t
)
self
.
_storage
.
store
(
ZERO
,
None
,
file
.
getvalue
(),
''
,
t
)
self
.
_storage
.
tpc_vote
(
t
)
self
.
_storage
.
tpc_vote
(
t
)
...
@@ -566,7 +566,7 @@ class PackableUndoStorage(PackableStorageBase):
...
@@ -566,7 +566,7 @@ class PackableUndoStorage(PackableStorageBase):
root
=
conn
.
root
()
root
=
conn
.
root
()
txn
=
transaction
.
get
()
txn
=
transaction
.
get
()
txn
.
note
(
'root'
)
txn
.
note
(
u
'root'
)
txn
.
commit
()
txn
.
commit
()
now
=
packtime
=
time
.
time
()
now
=
packtime
=
time
.
time
()
...
@@ -578,12 +578,12 @@ class PackableUndoStorage(PackableStorageBase):
...
@@ -578,12 +578,12 @@ class PackableUndoStorage(PackableStorageBase):
root
[
'obj'
]
=
obj
root
[
'obj'
]
=
obj
txn
=
transaction
.
get
()
txn
=
transaction
.
get
()
txn
.
note
(
'root -> o1'
)
txn
.
note
(
u
'root -> o1'
)
txn
.
commit
()
txn
.
commit
()
del
root
[
'obj'
]
del
root
[
'obj'
]
txn
=
transaction
.
get
()
txn
=
transaction
.
get
()
txn
.
note
(
'root -x-> o1'
)
txn
.
note
(
u
'root -x-> o1'
)
txn
.
commit
()
txn
.
commit
()
self
.
_storage
.
pack
(
packtime
,
referencesf
)
self
.
_storage
.
pack
(
packtime
,
referencesf
)
...
@@ -592,7 +592,7 @@ class PackableUndoStorage(PackableStorageBase):
...
@@ -592,7 +592,7 @@ class PackableUndoStorage(PackableStorageBase):
tid
=
log
[
0
][
'id'
]
tid
=
log
[
0
][
'id'
]
db
.
undo
(
tid
)
db
.
undo
(
tid
)
txn
=
transaction
.
get
()
txn
=
transaction
.
get
()
txn
.
note
(
'undo root -x-> o1'
)
txn
.
note
(
u
'undo root -x-> o1'
)
txn
.
commit
()
txn
.
commit
()
conn
.
sync
()
conn
.
sync
()
...
...
src/ZODB/tests/RecoveryStorage.py
View file @
d268d538
...
@@ -71,15 +71,15 @@ class RecoveryStorage(IteratorDeepCompare):
...
@@ -71,15 +71,15 @@ class RecoveryStorage(IteratorDeepCompare):
root
=
conn
.
root
()
root
=
conn
.
root
()
root
.
obj
=
obj1
=
MinPO
(
1
)
root
.
obj
=
obj1
=
MinPO
(
1
)
txn
=
transaction
.
get
()
txn
=
transaction
.
get
()
txn
.
note
(
'root -> obj'
)
txn
.
note
(
u
'root -> obj'
)
txn
.
commit
()
txn
.
commit
()
root
.
obj
.
obj
=
obj2
=
MinPO
(
2
)
root
.
obj
.
obj
=
obj2
=
MinPO
(
2
)
txn
=
transaction
.
get
()
txn
=
transaction
.
get
()
txn
.
note
(
'root -> obj -> obj'
)
txn
.
note
(
u
'root -> obj -> obj'
)
txn
.
commit
()
txn
.
commit
()
del
root
.
obj
del
root
.
obj
txn
=
transaction
.
get
()
txn
=
transaction
.
get
()
txn
.
note
(
'root -X->'
)
txn
.
note
(
u
'root -X->'
)
txn
.
commit
()
txn
.
commit
()
# Now copy the transactions to the destination
# Now copy the transactions to the destination
self
.
_dst
.
copyTransactionsFrom
(
self
.
_storage
)
self
.
_dst
.
copyTransactionsFrom
(
self
.
_storage
)
...
...
src/ZODB/tests/RevisionStorage.py
View file @
d268d538
...
@@ -122,7 +122,7 @@ class RevisionStorage:
...
@@ -122,7 +122,7 @@ class RevisionStorage:
tid
=
info
[
0
][
"id"
]
tid
=
info
[
0
][
"id"
]
# Always undo the most recent txn, so the value will
# Always undo the most recent txn, so the value will
# alternate between 3 and 4.
# alternate between 3 and 4.
self
.
_undo
(
tid
,
note
=
"undo %d"
%
i
)
self
.
_undo
(
tid
,
note
=
u
"undo %d"
%
i
)
revs
.
append
(
self
.
_storage
.
load
(
oid
,
""
))
revs
.
append
(
self
.
_storage
.
load
(
oid
,
""
))
prev_tid
=
None
prev_tid
=
None
...
...
src/ZODB/tests/StorageTestBase.py
View file @
d268d538
...
@@ -217,7 +217,7 @@ class StorageTestBase(ZODB.tests.util.TestCase):
...
@@ -217,7 +217,7 @@ class StorageTestBase(ZODB.tests.util.TestCase):
# Undo a tid that affects a single object (oid).
# Undo a tid that affects a single object (oid).
# This is very specialized.
# This is very specialized.
t
=
transaction
.
Transaction
()
t
=
transaction
.
Transaction
()
t
.
note
(
note
or
"undo"
)
t
.
note
(
note
or
u
"undo"
)
self
.
_storage
.
tpc_begin
(
t
)
self
.
_storage
.
tpc_begin
(
t
)
undo_result
=
self
.
_storage
.
undo
(
tid
,
t
)
undo_result
=
self
.
_storage
.
undo
(
tid
,
t
)
vote_result
=
self
.
_storage
.
tpc_vote
(
t
)
vote_result
=
self
.
_storage
.
tpc_vote
(
t
)
...
...
src/ZODB/tests/TransactionalUndoStorage.py
View file @
d268d538
...
@@ -135,19 +135,19 @@ class TransactionalUndoStorage:
...
@@ -135,19 +135,19 @@ class TransactionalUndoStorage:
info
=
self
.
_storage
.
undoInfo
()
info
=
self
.
_storage
.
undoInfo
()
# Now start an undo transaction
# Now start an undo transaction
self
.
_undo
(
info
[
0
][
"id"
],
[
oid
],
note
=
"undo1"
)
self
.
_undo
(
info
[
0
][
"id"
],
[
oid
],
note
=
u
"undo1"
)
data
,
revid
=
self
.
_storage
.
load
(
oid
,
''
)
data
,
revid
=
self
.
_storage
.
load
(
oid
,
''
)
eq
(
zodb_unpickle
(
data
),
MinPO
(
24
))
eq
(
zodb_unpickle
(
data
),
MinPO
(
24
))
# Do another one
# Do another one
info
=
self
.
_storage
.
undoInfo
()
info
=
self
.
_storage
.
undoInfo
()
self
.
_undo
(
info
[
2
][
"id"
],
[
oid
],
note
=
"undo2"
)
self
.
_undo
(
info
[
2
][
"id"
],
[
oid
],
note
=
u
"undo2"
)
data
,
revid
=
self
.
_storage
.
load
(
oid
,
''
)
data
,
revid
=
self
.
_storage
.
load
(
oid
,
''
)
eq
(
zodb_unpickle
(
data
),
MinPO
(
23
))
eq
(
zodb_unpickle
(
data
),
MinPO
(
23
))
# Try to undo the first record
# Try to undo the first record
info
=
self
.
_storage
.
undoInfo
()
info
=
self
.
_storage
.
undoInfo
()
self
.
_undo
(
info
[
4
][
"id"
],
[
oid
],
note
=
"undo3"
)
self
.
_undo
(
info
[
4
][
"id"
],
[
oid
],
note
=
u
"undo3"
)
# This should fail since we've undone the object's creation
# This should fail since we've undone the object's creation
self
.
assertRaises
(
KeyError
,
self
.
assertRaises
(
KeyError
,
self
.
_storage
.
load
,
oid
,
''
)
self
.
_storage
.
load
,
oid
,
''
)
...
@@ -167,7 +167,7 @@ class TransactionalUndoStorage:
...
@@ -167,7 +167,7 @@ class TransactionalUndoStorage:
info
=
self
.
_storage
.
undoInfo
()
info
=
self
.
_storage
.
undoInfo
()
tid
=
info
[
0
][
'id'
]
tid
=
info
[
0
][
'id'
]
t
=
Transaction
()
t
=
Transaction
()
t
.
note
(
'undo1'
)
t
.
note
(
u
'undo1'
)
self
.
_begin_undos_vote
(
t
,
tid
)
self
.
_begin_undos_vote
(
t
,
tid
)
self
.
_storage
.
tpc_finish
(
t
)
self
.
_storage
.
tpc_finish
(
t
)
# Check that calling getTid on an uncreated object raises a KeyError
# Check that calling getTid on an uncreated object raises a KeyError
...
@@ -490,7 +490,7 @@ class TransactionalUndoStorage:
...
@@ -490,7 +490,7 @@ class TransactionalUndoStorage:
root
[
'obj'
]
=
o1
root
[
'obj'
]
=
o1
o1
.
obj
=
o2
o1
.
obj
=
o2
txn
=
transaction
.
get
()
txn
=
transaction
.
get
()
txn
.
note
(
'o1 -> o2'
)
txn
.
note
(
u
'o1 -> o2'
)
txn
.
commit
()
txn
.
commit
()
now
=
packtime
=
time
.
time
()
now
=
packtime
=
time
.
time
()
while
packtime
<=
now
:
while
packtime
<=
now
:
...
@@ -499,12 +499,12 @@ class TransactionalUndoStorage:
...
@@ -499,12 +499,12 @@ class TransactionalUndoStorage:
o3
=
C
()
o3
=
C
()
o2
.
obj
=
o3
o2
.
obj
=
o3
txn
=
transaction
.
get
()
txn
=
transaction
.
get
()
txn
.
note
(
'o1 -> o2 -> o3'
)
txn
.
note
(
u
'o1 -> o2 -> o3'
)
txn
.
commit
()
txn
.
commit
()
o1
.
obj
=
o3
o1
.
obj
=
o3
txn
=
transaction
.
get
()
txn
=
transaction
.
get
()
txn
.
note
(
'o1 -> o3'
)
txn
.
note
(
u
'o1 -> o3'
)
txn
.
commit
()
txn
.
commit
()
log
=
self
.
_storage
.
undoLog
()
log
=
self
.
_storage
.
undoLog
()
...
@@ -522,7 +522,7 @@ class TransactionalUndoStorage:
...
@@ -522,7 +522,7 @@ class TransactionalUndoStorage:
tid
=
log
[
0
][
'id'
]
tid
=
log
[
0
][
'id'
]
db
.
undo
(
tid
)
db
.
undo
(
tid
)
txn
=
transaction
.
get
()
txn
=
transaction
.
get
()
txn
.
note
(
'undo'
)
txn
.
note
(
u
'undo'
)
txn
.
commit
()
txn
.
commit
()
# undo does a txn-undo, but doesn't invalidate
# undo does a txn-undo, but doesn't invalidate
conn
.
sync
()
conn
.
sync
()
...
@@ -549,14 +549,14 @@ class TransactionalUndoStorage:
...
@@ -549,14 +549,14 @@ class TransactionalUndoStorage:
root
[
"key1"
]
=
MinPO
(
1
)
root
[
"key1"
]
=
MinPO
(
1
)
root
[
"key2"
]
=
MinPO
(
2
)
root
[
"key2"
]
=
MinPO
(
2
)
txn
=
transaction
.
get
()
txn
=
transaction
.
get
()
txn
.
note
(
"create 3 keys"
)
txn
.
note
(
u
"create 3 keys"
)
txn
.
commit
()
txn
.
commit
()
set_pack_time
()
set_pack_time
()
del
root
[
"key1"
]
del
root
[
"key1"
]
txn
=
transaction
.
get
()
txn
=
transaction
.
get
()
txn
.
note
(
"delete 1 key"
)
txn
.
note
(
u
"delete 1 key"
)
txn
.
commit
()
txn
.
commit
()
set_pack_time
()
set_pack_time
()
...
@@ -568,7 +568,7 @@ class TransactionalUndoStorage:
...
@@ -568,7 +568,7 @@ class TransactionalUndoStorage:
L
=
db
.
undoInfo
()
L
=
db
.
undoInfo
()
db
.
undo
(
L
[
0
][
"id"
])
db
.
undo
(
L
[
0
][
"id"
])
txn
=
transaction
.
get
()
txn
=
transaction
.
get
()
txn
.
note
(
"undo deletion"
)
txn
.
note
(
u
"undo deletion"
)
txn
.
commit
()
txn
.
commit
()
set_pack_time
()
set_pack_time
()
...
@@ -600,7 +600,7 @@ class TransactionalUndoStorage:
...
@@ -600,7 +600,7 @@ class TransactionalUndoStorage:
transaction
.
commit
()
transaction
.
commit
()
rt
[
"test"
]
=
MinPO
(
3
)
rt
[
"test"
]
=
MinPO
(
3
)
txn
=
transaction
.
get
()
txn
=
transaction
.
get
()
txn
.
note
(
"root of undo"
)
txn
.
note
(
u
"root of undo"
)
txn
.
commit
()
txn
.
commit
()
packtimes
=
[]
packtimes
=
[]
...
@@ -608,7 +608,7 @@ class TransactionalUndoStorage:
...
@@ -608,7 +608,7 @@ class TransactionalUndoStorage:
L
=
db
.
undoInfo
()
L
=
db
.
undoInfo
()
db
.
undo
(
L
[
0
][
"id"
])
db
.
undo
(
L
[
0
][
"id"
])
txn
=
transaction
.
get
()
txn
=
transaction
.
get
()
txn
.
note
(
"undo %d"
%
i
)
txn
.
note
(
u
"undo %d"
%
i
)
txn
.
commit
()
txn
.
commit
()
rt
.
_p_deactivate
()
rt
.
_p_deactivate
()
cn
.
sync
()
cn
.
sync
()
...
@@ -665,7 +665,7 @@ class TransactionalUndoStorage:
...
@@ -665,7 +665,7 @@ class TransactionalUndoStorage:
i
=
0
i
=
0
for
tid
,
oid
,
revid
in
orig
:
for
tid
,
oid
,
revid
in
orig
:
self
.
_dostore
(
oid
,
revid
=
revid
,
data
=
MinPO
(
revid
),
self
.
_dostore
(
oid
,
revid
=
revid
,
data
=
MinPO
(
revid
),
description
=
"update %s"
%
i
)
description
=
u
"update %s"
%
i
)
# Undo the OBJECTS transactions that modified objects created
# Undo the OBJECTS transactions that modified objects created
# in the ith original transaction.
# in the ith original transaction.
...
@@ -725,9 +725,9 @@ class TransactionalUndoStorage:
...
@@ -725,9 +725,9 @@ class TransactionalUndoStorage:
def
checkUndoLogMetadata
(
self
):
def
checkUndoLogMetadata
(
self
):
# test that the metadata is correct in the undo log
# test that the metadata is correct in the undo log
t
=
transaction
.
get
()
t
=
transaction
.
get
()
t
.
note
(
't1'
)
t
.
note
(
u
't1'
)
t
.
setExtendedInfo
(
'k2'
,
'this is transaction metadata'
)
t
.
setExtendedInfo
(
'k2'
,
'this is transaction metadata'
)
t
.
setUser
(
'u3'
,
path
=
'p3'
)
t
.
setUser
(
u'u3'
,
path
=
u
'p3'
)
db
=
DB
(
self
.
_storage
)
db
=
DB
(
self
.
_storage
)
conn
=
db
.
open
()
conn
=
db
.
open
()
root
=
conn
.
root
()
root
=
conn
.
root
()
...
@@ -811,7 +811,7 @@ class TransactionalUndoStorage:
...
@@ -811,7 +811,7 @@ class TransactionalUndoStorage:
for
i
in
range
(
4
):
for
i
in
range
(
4
):
with
db
.
transaction
()
as
conn
:
with
db
.
transaction
()
as
conn
:
conn
.
transaction_manager
.
get
().
note
(
str
(
i
)
)
conn
.
transaction_manager
.
get
().
note
(
u"%s"
%
i
)
conn
.
root
.
x
.
inc
()
conn
.
root
.
x
.
inc
()
ids
=
[
l
[
'id'
]
for
l
in
db
.
undoLog
(
1
,
3
)]
ids
=
[
l
[
'id'
]
for
l
in
db
.
undoLog
(
1
,
3
)]
...
...
src/ZODB/tests/dangle.py
View file @
d268d538
...
@@ -30,19 +30,19 @@ def create_dangling_ref(db):
...
@@ -30,19 +30,19 @@ def create_dangling_ref(db):
rt
=
db
.
open
().
root
()
rt
=
db
.
open
().
root
()
rt
[
1
]
=
o1
=
P
()
rt
[
1
]
=
o1
=
P
()
transaction
.
get
().
note
(
"create o1"
)
transaction
.
get
().
note
(
u
"create o1"
)
transaction
.
commit
()
transaction
.
commit
()
rt
[
2
]
=
o2
=
P
()
rt
[
2
]
=
o2
=
P
()
transaction
.
get
().
note
(
"create o2"
)
transaction
.
get
().
note
(
u
"create o2"
)
transaction
.
commit
()
transaction
.
commit
()
c
=
o1
.
child
=
P
()
c
=
o1
.
child
=
P
()
transaction
.
get
().
note
(
"set child on o1"
)
transaction
.
get
().
note
(
u
"set child on o1"
)
transaction
.
commit
()
transaction
.
commit
()
o1
.
child
=
P
()
o1
.
child
=
P
()
transaction
.
get
().
note
(
"replace child on o1"
)
transaction
.
get
().
note
(
u
"replace child on o1"
)
transaction
.
commit
()
transaction
.
commit
()
time
.
sleep
(
2
)
time
.
sleep
(
2
)
...
@@ -53,7 +53,7 @@ def create_dangling_ref(db):
...
@@ -53,7 +53,7 @@ def create_dangling_ref(db):
print
(
repr
(
c
.
_p_oid
))
print
(
repr
(
c
.
_p_oid
))
o2
.
child
=
c
o2
.
child
=
c
transaction
.
get
().
note
(
"set child on o2"
)
transaction
.
get
().
note
(
u
"set child on o2"
)
transaction
.
commit
()
transaction
.
commit
()
def
main
():
def
main
():
...
...
src/ZODB/tests/testConnection.py
View file @
d268d538
...
@@ -484,7 +484,7 @@ def doctest_transaction_retry_convenience():
...
@@ -484,7 +484,7 @@ def doctest_transaction_retry_convenience():
>>> import ZODB.POSException
>>> import ZODB.POSException
>>> for attempt in transaction.manager.attempts():
>>> for attempt in transaction.manager.attempts():
... with attempt as t:
... with attempt as t:
... t.note('test')
... t.note(
u
'test')
... six.print_(dm['ntry'], ntry)
... six.print_(dm['ntry'], ntry)
... ntry += 1
... ntry += 1
... dm['ntry'] = ntry
... dm['ntry'] = ntry
...
...
src/ZODB/tests/testFileStorage.py
View file @
d268d538
...
@@ -65,7 +65,7 @@ class FileStorageTests(
...
@@ -65,7 +65,7 @@ class FileStorageTests(
self
.
open
(
create
=
1
)
self
.
open
(
create
=
1
)
def
checkLongMetadata
(
self
):
def
checkLongMetadata
(
self
):
s
=
"X"
*
75000
s
=
u
"X"
*
75000
try
:
try
:
self
.
_dostore
(
user
=
s
)
self
.
_dostore
(
user
=
s
)
except
POSException
.
StorageError
:
except
POSException
.
StorageError
:
...
...
src/ZODB/tests/testMVCCMappingStorage.py
View file @
d268d538
...
@@ -83,7 +83,7 @@ class MVCCTests:
...
@@ -83,7 +83,7 @@ class MVCCTests:
storage
=
c1
.
_storage
storage
=
c1
.
_storage
t
=
transaction
.
Transaction
()
t
=
transaction
.
Transaction
()
t
.
description
=
'isolation test 1'
t
.
description
=
u
'isolation test 1'
storage
.
tpc_begin
(
t
)
storage
.
tpc_begin
(
t
)
c1
.
commit
(
t
)
c1
.
commit
(
t
)
storage
.
tpc_vote
(
t
)
storage
.
tpc_vote
(
t
)
...
@@ -109,7 +109,7 @@ class MVCCTests:
...
@@ -109,7 +109,7 @@ class MVCCTests:
storage
=
c1
.
_storage
storage
=
c1
.
_storage
t
=
transaction
.
Transaction
()
t
=
transaction
.
Transaction
()
t
.
description
=
'isolation test 2'
t
.
description
=
u
'isolation test 2'
storage
.
tpc_begin
(
t
)
storage
.
tpc_begin
(
t
)
c1
.
commit
(
t
)
c1
.
commit
(
t
)
storage
.
tpc_vote
(
t
)
storage
.
tpc_vote
(
t
)
...
...
src/ZODB/tests/testZODB.py
View file @
d268d538
...
@@ -48,7 +48,7 @@ class ZODBTests(ZODB.tests.util.TestCase):
...
@@ -48,7 +48,7 @@ class ZODBTests(ZODB.tests.util.TestCase):
root
[
'test'
]
=
pm
=
PersistentMapping
()
root
[
'test'
]
=
pm
=
PersistentMapping
()
for
n
in
range
(
100
):
for
n
in
range
(
100
):
pm
[
n
]
=
PersistentMapping
({
0
:
100
-
n
})
pm
[
n
]
=
PersistentMapping
({
0
:
100
-
n
})
transaction
.
get
().
note
(
'created test data'
)
transaction
.
get
().
note
(
u
'created test data'
)
transaction
.
commit
()
transaction
.
commit
()
conn
.
close
()
conn
.
close
()
...
@@ -67,7 +67,7 @@ class ZODBTests(ZODB.tests.util.TestCase):
...
@@ -67,7 +67,7 @@ class ZODBTests(ZODB.tests.util.TestCase):
def
duplicate
(
self
,
conn
,
abort_it
):
def
duplicate
(
self
,
conn
,
abort_it
):
transaction
.
begin
()
transaction
.
begin
()
transaction
.
get
().
note
(
'duplication'
)
transaction
.
get
().
note
(
u
'duplication'
)
root
=
conn
.
root
()
root
=
conn
.
root
()
ob
=
root
[
'test'
]
ob
=
root
[
'test'
]
assert
len
(
ob
)
>
10
,
'Insufficient test data'
assert
len
(
ob
)
>
10
,
'Insufficient test data'
...
@@ -424,7 +424,7 @@ class ZODBTests(ZODB.tests.util.TestCase):
...
@@ -424,7 +424,7 @@ class ZODBTests(ZODB.tests.util.TestCase):
for
state_num
in
range
(
6
):
for
state_num
in
range
(
6
):
transaction
.
begin
()
transaction
.
begin
()
root
[
'state'
]
=
state_num
root
[
'state'
]
=
state_num
transaction
.
get
().
note
(
'root["state"] = %d'
%
state_num
)
transaction
.
get
().
note
(
u
'root["state"] = %d'
%
state_num
)
transaction
.
commit
()
transaction
.
commit
()
# Undo all but the first. Note that no work is actually
# Undo all but the first. Note that no work is actually
...
@@ -433,7 +433,7 @@ class ZODBTests(ZODB.tests.util.TestCase):
...
@@ -433,7 +433,7 @@ class ZODBTests(ZODB.tests.util.TestCase):
log
=
self
.
_db
.
undoLog
()
log
=
self
.
_db
.
undoLog
()
self
.
_db
.
undoMultiple
([
log
[
i
][
'id'
]
for
i
in
range
(
5
)])
self
.
_db
.
undoMultiple
([
log
[
i
][
'id'
]
for
i
in
range
(
5
)])
transaction
.
get
().
note
(
'undo states 1 through 5'
)
transaction
.
get
().
note
(
u
'undo states 1 through 5'
)
# Now attempt all those undo operations.
# Now attempt all those undo operations.
transaction
.
commit
()
transaction
.
commit
()
...
...
src/ZODB/tests/test_fsdump.py
View file @
d268d538
...
@@ -49,7 +49,7 @@ Let's add a BTree:
...
@@ -49,7 +49,7 @@ Let's add a BTree:
>>> root = db.open().root()
>>> root = db.open().root()
>>> root['tree'] = OOBTree()
>>> root['tree'] = OOBTree()
>>> txn.get().note('added an OOBTree')
>>> txn.get().note(
u
'added an OOBTree')
>>> txn.get().commit()
>>> txn.get().commit()
>>> fsdump(path) #doctest: +ELLIPSIS
>>> fsdump(path) #doctest: +ELLIPSIS
Trans #00000 tid=... time=... offset=<OFFSET>
Trans #00000 tid=... time=... offset=<OFFSET>
...
...
src/ZODB/tests/testfsoids.py
View file @
d268d538
...
@@ -76,7 +76,7 @@ Let's add a BTree and try again:
...
@@ -76,7 +76,7 @@ Let's add a BTree and try again:
>>> root = db.open().root()
>>> root = db.open().root()
>>> root['tree'] = OOBTree()
>>> root['tree'] = OOBTree()
>>> txn.get().note('added an OOBTree')
>>> txn.get().note(
u
'added an OOBTree')
>>> txn.get().commit()
>>> txn.get().commit()
>>> t = Tracer(path)
>>> t = Tracer(path)
>>> t.register_oids(0, 1)
>>> t.register_oids(0, 1)
...
@@ -104,7 +104,7 @@ One more, storing a reference in the BTree back to the root object:
...
@@ -104,7 +104,7 @@ One more, storing a reference in the BTree back to the root object:
>>> tree = root['tree']
>>> tree = root['tree']
>>> tree['root'] = root
>>> tree['root'] = root
>>> txn.get().note('circling back to the root')
>>> txn.get().note(
u
'circling back to the root')
>>> txn.get().commit()
>>> txn.get().commit()
>>> t = Tracer(path)
>>> t = Tracer(path)
>>> t.register_oids(0, 1, 2)
>>> t.register_oids(0, 1, 2)
...
...
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