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
76585b67
Commit
76585b67
authored
Jul 01, 2016
by
Jim Fulton
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/4'
Conflicts: src/ZODB/interfaces.py
parents
eb04da49
caf745f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
12 deletions
+41
-12
src/ZODB/interfaces.py
src/ZODB/interfaces.py
+41
-12
No files found.
src/ZODB/interfaces.py
View file @
76585b67
...
...
@@ -722,12 +722,8 @@ class IStorage(Interface):
called while the storage transaction lock is held. It takes
the new transaction id generated by the transaction.
The return value must be the committed tid. It is used to set the
serial for objects whose ids were passed to previous store calls
in the same transaction.
For compatibility, the return value can also be None, in which case
store/tpc_vote must return the serial of stored objects.
The return value may be None or the transaction id of the
committed transaction, as described in IMultiCommitStorage.
"""
def
tpc_vote
(
transaction
):
...
...
@@ -743,20 +739,53 @@ class IStorage(Interface):
without an error, then there must not be an error if
tpc_finish or tpc_abort is called subsequently.
The return value can be either None or a sequence of oids for which
a conflict was resolved.
For compatibility, the return value can also be a sequence of object-id
The return value can be None or a sequence of object-id
and serial pairs giving new serials for objects whose ids were
passed to previous store calls in the same transaction. The serial
can be the special value ZODB.ConflictResolution.ResolvedSerial to
indicate that a conflict occurred and that the object should be
invalidated.
The return value can also be a sequence of object ids, as
described in IMultiCommitStorage.tpc_vote.
After the tpc_vote call, all solved conflicts must have been notified,
either from tpc_vote or store for objects passed to store.
"""
class
IMultiCommitStorage
(
IStorage
):
"""A multi-commit storage can commit multiple transactions at once.
It's likely that future versions of ZODB will require all storages
to provide this interface.
"""
def
store
(
oid
,
serial
,
data
,
version
,
transaction
):
"""Store data for the object id, oid.
See IStorage.store. For objects implementing this interface,
the return value is always None.
"""
def
tpc_finish
(
transaction
,
func
=
lambda
tid
:
None
):
"""Finish the transaction, making any transaction changes permanent.
See IStorage.store. For objects implementing this interface,
the return value must be the committed tid. It is used to set the
serial for objects whose ids were passed to previous store calls
in the same transaction.
"""
def
tpc_vote
(
transaction
):
"""Provide a storage with an opportunity to veto a transaction
See IStorage.store. For objects implementing this interface,
the return value can be either None or a sequence of oids for which
a conflict was resolved.
"""
class
IStorageRestoreable
(
IStorage
):
"""Copying Transactions
...
...
@@ -893,8 +922,8 @@ class IStorageUndoable(IStorage):
This method must only be called in the first phase of
two-phase commit (after tpc_begin but before tpc_vote). It
returns a serial (transaction id) and a sequence of object ids
for objects affected by the transaction.
for objects affected by the transaction.
The serial is ignored
and may be None.
"""
# Used by DB (Actually, by TransactionalUndo)
...
...
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