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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
ZODB
Commits
cf02e50a
Commit
cf02e50a
authored
Jun 19, 2016
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add DeprecationWarning: IStorage.tpc_finish will have to return the committed tid
parent
74fba08a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
src/ZODB/Connection.py
src/ZODB/Connection.py
+15
-0
src/ZODB/interfaces.py
src/ZODB/interfaces.py
+5
-3
No files found.
src/ZODB/Connection.py
View file @
cf02e50a
...
@@ -818,8 +818,23 @@ class Connection(ExportImport, object):
...
@@ -818,8 +818,23 @@ class Connection(ExportImport, object):
if
obj
is
not
None
and
obj
.
_p_changed
is
not
None
:
if
obj
is
not
None
and
obj
.
_p_changed
is
not
None
:
obj
.
_p_changed
=
0
obj
.
_p_changed
=
0
obj
.
_p_serial
=
serial
obj
.
_p_serial
=
serial
else
:
self
.
_warn_about_returned_serial
()
self
.
_tpc_cleanup
()
self
.
_tpc_cleanup
()
def
_warn_about_returned_serial
(
self
):
# Do not warn about own implementations of ZODB.
# We're aware and the user can't do anything about it.
if
self
.
_normal_storage
.
__module__
.
startswith
(
"_ZODB."
):
self
.
_warn_about_returned_serial
=
lambda
:
None
else
:
warnings
.
warn
(
"In ZODB 5+, it will be required for tpc_finish to return the"
" committed tid. store/tpc_vote will only have to notify about"
" resolved conflicts."
,
DeprecationWarning
,
2
)
Connection
.
_warn_about_returned_serial
=
lambda
self
:
None
def
sortKey
(
self
):
def
sortKey
(
self
):
"""Return a consistent sort key for this connection."""
"""Return a consistent sort key for this connection."""
return
"%s:%s"
%
(
self
.
_storage
.
sortKey
(),
id
(
self
))
return
"%s:%s"
%
(
self
.
_storage
.
sortKey
(),
id
(
self
))
...
...
src/ZODB/interfaces.py
View file @
cf02e50a
...
@@ -776,10 +776,12 @@ class IStorage(Interface):
...
@@ -776,10 +776,12 @@ class IStorage(Interface):
called while the storage transaction lock is held. It takes
called while the storage transaction lock is held. It takes
the new transaction id generated by the transaction.
the new transaction id generated by the transaction.
The return value
can be either None or a serial giving new
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
serial for objects whose ids were passed to previous store calls
in the same transaction, and for which no serial was returned
in the same transaction.
from either store or tpc_vote for objects passed to store.
For compatibility, the return value can also be None, in which case
store/tpc_vote must return the serial of stored objects.
"""
"""
def
tpc_vote
(
transaction
):
def
tpc_vote
(
transaction
):
...
...
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