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
4d0512f1
Commit
4d0512f1
authored
Jul 06, 2016
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Various fixes suggested in review
parent
7e1db13f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
13 deletions
+13
-13
src/ZODB/DemoStorage.py
src/ZODB/DemoStorage.py
+11
-2
src/ZODB/FileStorage/FileStorage.py
src/ZODB/FileStorage/FileStorage.py
+1
-3
src/ZODB/MappingStorage.py
src/ZODB/MappingStorage.py
+1
-6
src/ZODB/tests/blob_transaction.txt
src/ZODB/tests/blob_transaction.txt
+0
-2
No files found.
src/ZODB/DemoStorage.py
View file @
4d0512f1
...
...
@@ -73,6 +73,7 @@ class DemoStorage(ConflictResolvingStorage):
self
.
_issued_oids
=
set
()
self
.
_stored_oids
=
set
()
self
.
_resolved
=
[]
self
.
_commit_lock
=
ZODB
.
utils
.
Lock
()
self
.
_transaction
=
None
...
...
@@ -116,7 +117,7 @@ class DemoStorage(ConflictResolvingStorage):
for
meth
in
(
'_lock'
,
'getSize'
,
'isReadOnly'
,
'sortKey'
,
'tpc_transaction'
,
'tpc_vote'
,
'sortKey'
,
'tpc_transaction'
,
):
setattr
(
self
,
meth
,
getattr
(
changes
,
meth
))
...
...
@@ -308,7 +309,8 @@ class DemoStorage(ConflictResolvingStorage):
if
old
!=
serial
:
rdata
=
self
.
tryToResolveConflict
(
oid
,
old
,
serial
,
data
)
self
.
changes
.
store
(
oid
,
old
,
rdata
,
''
,
transaction
,
True
)
self
.
changes
.
store
(
oid
,
old
,
rdata
,
''
,
transaction
)
self
.
_resolved
.
append
(
oid
)
else
:
self
.
changes
.
store
(
oid
,
serial
,
data
,
''
,
transaction
)
...
...
@@ -364,6 +366,13 @@ class DemoStorage(ConflictResolvingStorage):
self
.
changes
.
tpc_begin
(
transaction
,
*
a
,
**
k
)
self
.
_transaction
=
transaction
self
.
_stored_oids
=
set
()
del
self
.
_resolved
[:]
def
tpc_vote
(
self
,
*
a
,
**
k
):
if
self
.
changes
.
tpc_vote
(
*
a
,
**
k
):
raise
ZODB
.
POSException
.
StorageTransactionError
(
"Unexpected resolved conflicts"
)
return
self
.
_resolved
def
tpc_finish
(
self
,
transaction
,
func
=
lambda
tid
:
None
):
with
self
.
_lock
:
...
...
src/ZODB/FileStorage/FileStorage.py
View file @
4d0512f1
...
...
@@ -520,6 +520,7 @@ class FileStorage(
if
oldserial
!=
committed_tid
:
data
=
self
.
tryToResolveConflict
(
oid
,
committed_tid
,
oldserial
,
data
)
self
.
_resolved
.
append
(
oid
)
pos
=
self
.
_pos
here
=
pos
+
self
.
_tfile
.
tell
()
+
self
.
_thl
...
...
@@ -534,9 +535,6 @@ class FileStorage(
raise
FileStorageQuotaError
(
"The storage quota has been exceeded."
)
if
old
and
oldserial
!=
committed_tid
:
self
.
_resolved
.
append
(
oid
)
def
deleteObject
(
self
,
oid
,
oldserial
,
transaction
):
if
self
.
_is_read_only
:
raise
ReadOnlyError
()
...
...
src/ZODB/MappingStorage.py
View file @
4d0512f1
...
...
@@ -43,7 +43,6 @@ class MappingStorage(object):
self
.
_commit_lock
=
ZODB
.
utils
.
Lock
()
self
.
_opened
=
True
self
.
_transaction
=
None
self
.
_resolved
=
[]
self
.
_oid
=
0
######################################################################
...
...
@@ -233,7 +232,7 @@ class MappingStorage(object):
# ZODB.interfaces.IStorage
@
ZODB
.
utils
.
locked
(
opened
)
def
store
(
self
,
oid
,
serial
,
data
,
version
,
transaction
,
resolved
=
False
):
def
store
(
self
,
oid
,
serial
,
data
,
version
,
transaction
):
assert
not
version
,
"Versions are not supported"
if
transaction
is
not
self
.
_transaction
:
raise
ZODB
.
POSException
.
StorageTransactionError
(
self
,
transaction
)
...
...
@@ -247,8 +246,6 @@ class MappingStorage(object):
oid
=
oid
,
serials
=
(
old_tid
,
serial
),
data
=
data
)
self
.
_tdata
[
oid
]
=
data
if
resolved
:
self
.
_resolved
.
append
(
oid
)
checkCurrentSerialInTransaction
=
(
ZODB
.
BaseStorage
.
checkCurrentSerialInTransaction
)
...
...
@@ -284,7 +281,6 @@ class MappingStorage(object):
old_tid
=
None
tid
=
ZODB
.
utils
.
newTid
(
old_tid
)
self
.
_tid
=
tid
del
self
.
_resolved
[:]
# ZODB.interfaces.IStorage
@
ZODB
.
utils
.
locked
(
opened
)
...
...
@@ -321,7 +317,6 @@ class MappingStorage(object):
if
transaction
is
not
self
.
_transaction
:
raise
ZODB
.
POSException
.
StorageTransactionError
(
"tpc_vote called with wrong transaction"
)
return
self
.
_resolved
class
TransactionRecord
:
...
...
src/ZODB/tests/blob_transaction.txt
View file @
4d0512f1
...
...
@@ -390,8 +390,6 @@ stored are discarded.
... '', t)
>>> bool(blob_storage.tpc_vote(t))
False
>>> oldserial < blob_storage._tid
True
>>> blob_storage.tpc_abort(t)
Now, the serial for the existing blob should be the same:
...
...
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