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
d81f60fe
Commit
d81f60fe
authored
Jun 03, 2014
by
Jim Fulton
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #19 from zopefoundation/GH-16
Fix for #16 Thanks!
parents
8ef6f470
78fe684d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
CHANGES.rst
CHANGES.rst
+3
-0
src/ZODB/Connection.py
src/ZODB/Connection.py
+2
-1
src/ZODB/tests/testZODB.py
src/ZODB/tests/testZODB.py
+24
-0
No files found.
CHANGES.rst
View file @
d81f60fe
...
...
@@ -5,6 +5,9 @@
4.0.1 (unreleased)
==================
- Fix POSKeyError during transaction.commit when after savepoint.rollback.
see https://github.com/zopefoundation/ZODB/issues/16
- Ensure that the pickler used in PyPy always has a ``persistent_id``
attribute (``inst_persistent_id`` is not present on the pure-Python
pickler). (PR #17)
...
...
src/ZODB/Connection.py
View file @
d81f60fe
...
...
@@ -997,7 +997,8 @@ class Connection(ExportImport, object):
def
readCurrent
(
self
,
ob
):
assert
ob
.
_p_jar
is
self
assert
ob
.
_p_oid
is
not
None
and
ob
.
_p_serial
is
not
None
self
.
_readCurrent
[
ob
.
_p_oid
]
=
ob
.
_p_serial
if
ob
.
_p_serial
!=
z64
:
self
.
_readCurrent
[
ob
.
_p_oid
]
=
ob
.
_p_serial
# persistent.interfaces.IPersistentDatamanager
##########################################################################
...
...
src/ZODB/tests/testZODB.py
View file @
d81f60fe
...
...
@@ -17,6 +17,7 @@ from ZODB.POSException import ReadConflictError
from
ZODB.POSException
import
TransactionFailedError
import
doctest
from
BTrees.OOBTree
import
OOBTree
import
transaction
import
unittest
import
ZODB
...
...
@@ -27,6 +28,7 @@ import ZODB.tests.util
class
P
(
Persistent
):
pass
class
ZODBTests
(
ZODB
.
tests
.
util
.
TestCase
):
def
setUp
(
self
):
...
...
@@ -327,6 +329,28 @@ class ZODBTests(ZODB.tests.util.TestCase):
cn
.
close
()
def
checkSavepointRollbackAndReadCurrent
(
self
):
'''
savepoint rollback after readcurrent was called on a new object
should not raise POSKeyError
'''
cn
=
self
.
_db
.
open
()
try
:
transaction
.
begin
()
root
=
cn
.
root
()
added_before_savepoint
=
P
()
root
[
'added_before_savepoint'
]
=
added_before_savepoint
sp
=
transaction
.
savepoint
()
added_before_savepoint
.
btree
=
new_btree
=
OOBTree
()
cn
.
add
(
new_btree
)
new_btree
[
'change_to_trigger_read_current'
]
=
P
()
sp
.
rollback
()
transaction
.
commit
()
self
.
assertTrue
(
'added_before_savepoint'
in
root
)
finally
:
transaction
.
abort
()
cn
.
close
()
def
checkFailingSavepointSticks
(
self
):
cn
=
self
.
_db
.
open
()
rt
=
cn
.
root
()
...
...
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