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
ed89cb00
Commit
ed89cb00
authored
Mar 02, 2004
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove _incrgc attribute of Connection.
Add docstrings for public cache methods.
parent
8fc78a90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
7 deletions
+21
-7
src/ZODB/Connection.py
src/ZODB/Connection.py
+21
-7
No files found.
src/ZODB/Connection.py
View file @
ed89cb00
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
##############################################################################
##############################################################################
"""Database connection support
"""Database connection support
$Id: Connection.py,v 1.13
1 2004/03/01 19:07:25
jeremy Exp $"""
$Id: Connection.py,v 1.13
2 2004/03/02 15:43:16
jeremy Exp $"""
import
logging
import
logging
import
sys
import
sys
...
@@ -102,7 +102,7 @@ class Connection(ExportImport, object):
...
@@ -102,7 +102,7 @@ class Connection(ExportImport, object):
XXX Mention the database pool.
XXX Mention the database pool.
$Id: Connection.py,v 1.13
1 2004/03/01 19:07:25
jeremy Exp $
$Id: Connection.py,v 1.13
2 2004/03/02 15:43:16
jeremy Exp $
@group User Methods: root, get, add, close, db, sync, isReadOnly,
@group User Methods: root, get, add, close, db, sync, isReadOnly,
cacheFullSweep, cacheMinimize, getVersion, modifiedInVersion
cacheFullSweep, cacheMinimize, getVersion, modifiedInVersion
...
@@ -146,7 +146,6 @@ class Connection(ExportImport, object):
...
@@ -146,7 +146,6 @@ class Connection(ExportImport, object):
# XXX Why do we want version caches to behave this way?
# XXX Why do we want version caches to behave this way?
self
.
_cache
.
cache_drain_resistance
=
100
self
.
_cache
.
cache_drain_resistance
=
100
self
.
_incrgc
=
self
.
cacheGC
=
cache
.
incrgc
self
.
_committed
=
[]
self
.
_committed
=
[]
self
.
_added
=
{}
self
.
_added
=
{}
self
.
_reset_counter
=
global_reset_counter
self
.
_reset_counter
=
global_reset_counter
...
@@ -348,7 +347,6 @@ class Connection(ExportImport, object):
...
@@ -348,7 +347,6 @@ class Connection(ExportImport, object):
self
.
_invalidated
.
clear
()
self
.
_invalidated
.
clear
()
cache_size
=
self
.
_cache
.
cache_size
cache_size
=
self
.
_cache
.
cache_size
self
.
_cache
=
cache
=
PickleCache
(
self
,
cache_size
)
self
.
_cache
=
cache
=
PickleCache
(
self
,
cache_size
)
self
.
_incrgc
=
self
.
cacheGC
=
cache
.
incrgc
def
abort
(
self
,
object
,
transaction
):
def
abort
(
self
,
object
,
transaction
):
"""Abort the object in the transaction.
"""Abort the object in the transaction.
...
@@ -380,12 +378,28 @@ class Connection(ExportImport, object):
...
@@ -380,12 +378,28 @@ class Connection(ExportImport, object):
self
.
_cache
.
full_sweep
(
dt
)
self
.
_cache
.
full_sweep
(
dt
)
def
cacheMinimize
(
self
,
dt
=
None
):
def
cacheMinimize
(
self
,
dt
=
None
):
# XXX needs doc string
"""Deactivate all unmodified objects in the cache.
Call _p_deactivate() on each cached object, attempting to turn
it into a ghost. It is possible for individual objects to
remain active.
@param dt: The dt argument is provided only for backwards
compatibility. It is ignored.
"""
if
dt
is
not
None
:
if
dt
is
not
None
:
warnings
.
warn
(
"The dt argument to cacheMinimize is ignored."
,
warnings
.
warn
(
"The dt argument to cacheMinimize is ignored."
,
DeprecationWarning
)
DeprecationWarning
)
self
.
_cache
.
minimize
()
self
.
_cache
.
minimize
()
def
cacheGC
(
self
):
"""Reduce cache size to target size.
Call _p_deactivate() on cached objects until the cache size
falls under the target size.
"""
self
.
_cache
.
incrgc
()
__onCloseCallbacks
=
None
__onCloseCallbacks
=
None
def
onCloseCallback
(
self
,
f
):
def
onCloseCallback
(
self
,
f
):
...
@@ -410,8 +424,8 @@ class Connection(ExportImport, object):
...
@@ -410,8 +424,8 @@ class Connection(ExportImport, object):
L{onCloseCallback} are invoked and the cache is scanned for
L{onCloseCallback} are invoked and the cache is scanned for
old objects.
old objects.
"""
"""
if
self
.
_
incrgc
is
not
None
:
if
self
.
_
cache
is
not
None
:
self
.
_incrgc
()
# This is a good time to do some GC
self
.
_
cache
.
incrgc
()
# This is a good time to do some GC
# Call the close callbacks.
# Call the close callbacks.
if
self
.
__onCloseCallbacks
is
not
None
:
if
self
.
__onCloseCallbacks
is
not
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