Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Kirill Smelkov
ZEO
Commits
403321d4
Commit
403321d4
authored
Oct 07, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed to log any error when loading an objects state, including
storage errors.
parent
96d783ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
21 deletions
+19
-21
src/ZODB/Connection.py
src/ZODB/Connection.py
+19
-21
No files found.
src/ZODB/Connection.py
View file @
403321d4
...
...
@@ -84,8 +84,8 @@
##############################################################################
"""Database connection support
$Id: Connection.py,v 1.2
7 1999/10/07 14:17:50
jim Exp $"""
__version__
=
'$Revision: 1.2
7
$'
[
11
:
-
2
]
$Id: Connection.py,v 1.2
8 1999/10/07 22:41:01
jim Exp $"""
__version__
=
'$Revision: 1.2
8
$'
[
11
:
-
2
]
from
cPickleCache
import
PickleCache
from
POSException
import
ConflictError
,
ExportError
...
...
@@ -384,32 +384,30 @@ class Connection(ExportImport.ExportImport):
def
root
(
self
):
return
self
[
'
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
'
]
def
setstate
(
self
,
object
):
# Note, we no longer mess with the object's state
# flag, _p_changed. This is the object's job.
oid
=
object
.
_p_oid
invalid
=
self
.
_invalid
if
invalid
(
oid
)
or
invalid
(
None
):
raise
ConflictError
,
oid
p
,
serial
=
self
.
_storage
.
load
(
oid
,
self
.
_version
)
file
=
StringIO
(
p
)
unpickler
=
Unpickler
(
file
)
unpickler
.
persistent_load
=
self
.
_persistent_load
try
:
oid
=
object
.
_p_oid
invalid
=
self
.
_invalid
if
invalid
(
oid
)
or
invalid
(
None
):
raise
ConflictError
,
oid
p
,
serial
=
self
.
_storage
.
load
(
oid
,
self
.
_version
)
file
=
StringIO
(
p
)
unpickler
=
Unpickler
(
file
)
unpickler
.
persistent_load
=
self
.
_persistent_load
unpickler
.
load
()
state
=
unpickler
.
load
()
if
hasattr
(
object
,
'__setstate__'
):
object
.
__setstate__
(
state
)
else
:
d
=
object
.
__dict__
for
k
,
v
in
state
.
items
():
d
[
k
]
=
v
object
.
_p_serial
=
serial
except
:
t
,
v
=
sys
.
exc_info
()[:
2
]
LOG
(
'ZODB'
,
ERROR
,
"Couldn't unnpickle %s"
%
`oid`
,
LOG
(
'ZODB'
,
ERROR
,
"Couldn't load state for %s"
%
`oid`
,
error
=
sys
.
exc_info
())
raise
if
hasattr
(
object
,
'__setstate__'
):
object
.
__setstate__
(
state
)
else
:
d
=
object
.
__dict__
for
k
,
v
in
state
.
items
():
d
[
k
]
=
v
object
.
_p_serial
=
serial
def
setklassstate
(
self
,
object
,
tt
=
type
(()),
ct
=
type
(
HelperClass
)):
...
...
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