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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
98eb0f1e
Commit
98eb0f1e
authored
Jan 09, 2002
by
Brian Lloyd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a lost update from the __module__ merge.
parent
8e59b888
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
src/ZODB/DB.py
src/ZODB/DB.py
+17
-12
No files found.
src/ZODB/DB.py
View file @
98eb0f1e
...
...
@@ -12,8 +12,8 @@
##############################################################################
"""Database objects
$Id: DB.py,v 1.3
7 2002/01/09 18:54:20
Brian Exp $"""
__version__
=
'$Revision: 1.3
7
$'
[
11
:
-
2
]
$Id: DB.py,v 1.3
8 2002/01/09 19:15:31
Brian Exp $"""
__version__
=
'$Revision: 1.3
8
$'
[
11
:
-
2
]
import
cPickle
,
cStringIO
,
sys
,
POSException
,
UndoLogCompatible
from
Connection
import
Connection
...
...
@@ -72,15 +72,20 @@ class DB(UndoLogCompatible.UndoLogCompatible):
self
.
_storage
=
storage
storage
.
registerDB
(
self
,
None
)
if
not
hasattr
(
storage
,
'tpc_vote'
):
storage
.
tpc_vote
=
lambda
*
args
:
None
try
:
storage
.
load
(
'
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
'
,
''
)
except
:
try
:
storage
.
load
(
'
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
'
,
''
)
except
KeyError
:
# Create the database's root in the storage if it doesn't exist
import
PersistentMapping
file
=
cStringIO
.
StringIO
()
p
=
cPickle
.
Pickler
(
file
,
1
)
p
.
dump
((
PersistentMapping
.
PersistentMapping
,
None
))
p
.
dump
({
'_container'
:
{}})
t
=
Transaction
()
t
.
description
=
'initial database creation'
root
=
PersistentMapping
.
PersistentMapping
()
# Manually create a pickle for the root to put in the storage.
# The pickle must be in the special ZODB format.
file
=
cStringIO
.
StringIO
()
p
=
cPickle
.
Pickler
(
file
,
1
)
p
.
dump
((
root
.
__class__
,
None
))
p
.
dump
(
root
.
__getstate__
())
t
=
Transaction
()
t
.
description
=
'initial database creation'
storage
.
tpc_begin
(
t
)
storage
.
store
(
'
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
'
,
None
,
file
.
getvalue
(),
''
,
t
)
storage
.
tpc_vote
(
t
)
...
...
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