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
Kirill Smelkov
ZODB
Commits
ad25595e
Commit
ad25595e
authored
Jun 15, 2016
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactred the way historical connections work to work with RelStorage
parent
fad84bd6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
src/ZODB/Connection.py
src/ZODB/Connection.py
+5
-4
src/ZODB/mvccadapter.py
src/ZODB/mvccadapter.py
+5
-3
No files found.
src/ZODB/Connection.py
View file @
ad25595e
...
@@ -49,6 +49,8 @@ from ZODB.utils import p64, u64, z64, oid_repr, positive_id
...
@@ -49,6 +49,8 @@ from ZODB.utils import p64, u64, z64, oid_repr, positive_id
from
ZODB
import
utils
from
ZODB
import
utils
import
six
import
six
from
.mvccadapter
import
HistoricalStorageAdapter
global_reset_counter
=
0
global_reset_counter
=
0
noop
=
lambda
:
None
noop
=
lambda
:
None
...
@@ -101,11 +103,10 @@ class Connection(ExportImport, object):
...
@@ -101,11 +103,10 @@ class Connection(ExportImport, object):
# Multi-database support
# Multi-database support
self
.
connections
=
{
self
.
_db
.
database_name
:
self
}
self
.
connections
=
{
self
.
_db
.
database_name
:
self
}
storage
=
db
.
_mvcc_storage
if
before
:
if
before
:
storage
=
storage
.
before_instance
(
before
)
storage
=
HistoricalStorageAdapter
(
db
.
storage
,
before
)
else
:
else
:
storage
=
storage
.
new_instance
()
storage
=
db
.
_mvcc_
storage
.
new_instance
()
self
.
_normal_storage
=
self
.
_storage
=
storage
self
.
_normal_storage
=
self
.
_storage
=
storage
self
.
new_oid
=
db
.
new_oid
self
.
new_oid
=
db
.
new_oid
...
@@ -308,7 +309,7 @@ class Connection(ExportImport, object):
...
@@ -308,7 +309,7 @@ class Connection(ExportImport, object):
"""Returns True if this connection is read only."""
"""Returns True if this connection is read only."""
if
self
.
opened
is
None
:
if
self
.
opened
is
None
:
raise
ConnectionStateError
(
"The database connection is closed"
)
raise
ConnectionStateError
(
"The database connection is closed"
)
return
self
.
before
is
not
None
or
self
.
_storage
.
isReadOnly
()
return
self
.
_storage
.
isReadOnly
()
@
property
@
property
def
root
(
self
):
def
root
(
self
):
...
...
src/ZODB/mvccadapter.py
View file @
ad25595e
...
@@ -177,15 +177,17 @@ class MVCCAdapterInstance(Base):
...
@@ -177,15 +177,17 @@ class MVCCAdapterInstance(Base):
def
read_only_writer
(
self
,
*
a
,
**
kw
):
def
read_only_writer
(
self
,
*
a
,
**
kw
):
raise
POSException
.
ReadOnlyError
raise
POSException
.
ReadOnlyError
class
BeforeAdapterInstance
(
Base
):
class
HistoricalStorageAdapter
(
Base
):
"""Adapt a storage to a historical storage
"""
_copy_methods
=
Base
.
_copy_methods
+
(
_copy_methods
=
Base
.
_copy_methods
+
(
'loadSerial'
,
'tpc_begin'
,
'tpc_finish'
,
'tpc_abort'
,
'tpc_vote'
,
'loadSerial'
,
'tpc_begin'
,
'tpc_finish'
,
'tpc_abort'
,
'tpc_vote'
,
'checkCurrentSerialInTransaction'
,
'checkCurrentSerialInTransaction'
,
)
)
def
__init__
(
self
,
bas
e
,
before
=
None
):
def
__init__
(
self
,
storag
e
,
before
=
None
):
Base
.
__init__
(
self
,
base
.
_
storage
)
Base
.
__init__
(
self
,
storage
)
self
.
_before
=
before
self
.
_before
=
before
def
isReadOnly
(
self
):
def
isReadOnly
(
self
):
...
...
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