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
2dd378d9
Commit
2dd378d9
authored
Jul 30, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a small cache for modifiedInVersion, which is called often from management interface.
parent
bb58829f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
src/ZODB/DB.py
src/ZODB/DB.py
+23
-3
No files found.
src/ZODB/DB.py
View file @
2dd378d9
...
@@ -84,8 +84,8 @@
...
@@ -84,8 +84,8 @@
##############################################################################
##############################################################################
"""Database objects
"""Database objects
$Id: DB.py,v 1.1
1 1999/07/14 11:32:31
jim Exp $"""
$Id: DB.py,v 1.1
2 1999/07/30 14:34:33
jim Exp $"""
__version__
=
'$Revision: 1.1
1
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
2
$'
[
11
:
-
2
]
import
cPickle
,
cStringIO
,
sys
,
POSException
import
cPickle
,
cStringIO
,
sys
,
POSException
from
Connection
import
Connection
from
Connection
import
Connection
...
@@ -149,8 +149,10 @@ class DB:
...
@@ -149,8 +149,10 @@ class DB:
self
.
_version_cache_size
=
version_cache_size
self
.
_version_cache_size
=
version_cache_size
self
.
_version_cache_deactivate_after
=
version_cache_deactivate_after
self
.
_version_cache_deactivate_after
=
version_cache_deactivate_after
self
.
_miv_cache
=
{}
# Pass through methods:
# Pass through methods:
for
m
in
(
'history'
,
'modifiedInVersion'
,
for
m
in
(
'history'
,
'supportsUndo'
,
'supportsVersions'
,
'undoLog'
,
'supportsUndo'
,
'supportsVersions'
,
'undoLog'
,
'versionEmpty'
,
'versions'
):
'versionEmpty'
,
'versions'
):
setattr
(
self
,
m
,
getattr
(
storage
,
m
))
setattr
(
self
,
m
,
getattr
(
storage
,
m
))
...
@@ -310,6 +312,14 @@ class DB:
...
@@ -310,6 +312,14 @@ class DB:
if
connection
is
not
None
:
version
=
connection
.
_version
if
connection
is
not
None
:
version
=
connection
.
_version
self
.
_a
()
self
.
_a
()
try
:
try
:
# Update modified in version cache
h
=
hash
(
oid
)
%
131
cache
=
self
.
_miv_cache
o
=
cache
.
get
(
h
,
None
)
if
o
and
o
[
0
]
==
oid
:
del
cache
[
h
]
# Notify connections
pools
,
pooll
=
self
.
_pools
pools
,
pooll
=
self
.
_pools
for
pool
,
allocated
in
pooll
:
for
pool
,
allocated
in
pooll
:
for
cc
in
allocated
:
for
cc
in
allocated
:
...
@@ -336,6 +346,16 @@ class DB:
...
@@ -336,6 +346,16 @@ class DB:
else
:
else
:
for
oid
in
oids
:
self
.
invalidate
(
oid
,
version
=
version
)
for
oid
in
oids
:
self
.
invalidate
(
oid
,
version
=
version
)
def
modifiedInVersion
(
self
,
oid
):
h
=
hash
(
oid
)
%
131
cache
=
self
.
_miv_cache
o
=
cache
.
get
(
h
,
None
)
if
o
and
o
[
0
]
==
oid
:
return
o
[
1
]
v
=
self
.
_storage
.
modifiedInVersion
(
oid
)
cache
[
h
]
=
oid
,
v
return
v
def
objectCount
(
self
):
return
len
(
self
.
_storage
)
def
objectCount
(
self
):
return
len
(
self
.
_storage
)
def
open
(
self
,
version
=
''
,
transaction
=
None
,
temporary
=
0
,
force
=
None
,
def
open
(
self
,
version
=
''
,
transaction
=
None
,
temporary
=
0
,
force
=
None
,
...
...
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