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
d50d85bf
Commit
d50d85bf
authored
Jul 03, 2006
by
Florent Guillaume
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added comments, shuffled stuff around a bit.
parent
90acc2a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
12 deletions
+36
-12
src/ZODB/Connection.py
src/ZODB/Connection.py
+36
-12
No files found.
src/ZODB/Connection.py
View file @
d50d85bf
...
@@ -75,6 +75,7 @@ class Connection(ExportImport, object):
...
@@ -75,6 +75,7 @@ class Connection(ExportImport, object):
"""Create a new Connection."""
"""Create a new Connection."""
self
.
_db
=
db
self
.
_db
=
db
self
.
_version
=
version
self
.
_normal_storage
=
self
.
_storage
=
db
.
_storage
self
.
_normal_storage
=
self
.
_storage
=
db
.
_storage
self
.
new_oid
=
db
.
_storage
.
new_oid
self
.
new_oid
=
db
.
_storage
.
new_oid
self
.
_savepoint_storage
=
None
self
.
_savepoint_storage
=
None
...
@@ -87,32 +88,55 @@ class Connection(ExportImport, object):
...
@@ -87,32 +88,55 @@ class Connection(ExportImport, object):
self
.
_debug_info
=
()
self
.
_debug_info
=
()
self
.
_opened
=
None
# time.time() when DB.open() opened us
self
.
_opened
=
None
# time.time() when DB.open() opened us
self
.
_version
=
version
self
.
_reset_counter
=
global_reset_counter
self
.
_load_count
=
0
# Number of objects unghosted
self
.
_store_count
=
0
# Number of objects stored
# Do we need to join a txn manager?
self
.
_needs_to_join
=
True
# Cache which can ghostify (forget the state of) objects not
# recently used. Its API is roughly that of a dict, with
# additional gc-related and invalidation-related methods.
self
.
_cache
=
PickleCache
(
self
,
cache_size
)
self
.
_cache
=
PickleCache
(
self
,
cache_size
)
if
version
:
if
version
:
# Caches for versions end up empty if the version
# Caches for versions end up empty if the version
# is not used for a while. Non-version caches
# is not used for a while. Non-version caches
# keep their content indefinitely.
# keep their content indefinitely.
# Unclear: Why do we want version caches to behave this way?
# Unclear: Why do we want version caches to behave this way?
self
.
_cache
.
cache_drain_resistance
=
100
self
.
_cache
.
cache_drain_resistance
=
100
# List of all objects (not oids) registered as modified by the
# persistence machinery, or by add(), or whose access caused a
# ReadConflictError (just to be able to clean them up from the
# cache on abort with the other modified objects). All objects
# of this list are either in _cache or in _added.
self
.
_registered_objects
=
[]
# Dict of oid->obj added explicitly through add(). Used as a
# preliminary cache until commit time when objects are all moved
# to the real _cache. The objects are moved to _creating at
# commit time.
self
.
_added
=
{}
self
.
_added
=
{}
# During commit this is turned into a list, which receives
# objects added as a side-effect of storing a modified object.
self
.
_added_during_commit
=
None
self
.
_added_during_commit
=
None
self
.
_reset_counter
=
global_reset_counter
self
.
_load_count
=
0
# Number of objects unghosted
# During commit, all objects go to either _modified or _creating:
self
.
_store_count
=
0
# Number of objects stored
# Dict of oid->flag of new objects (without serial), either
# added by add() or implicitely added (discovered by the
# serializer during commit). The flag is True for implicit
# adding. Used during abort to remove created objects from the
# _cache, and by persistent_id to check that a new object isn't
# reachable from multiple databases.
self
.
_creating
=
{}
self
.
_creating
=
{}
# List of oids of modified objects (to be invalidated on an abort).
# List of oids of modified objects, which have to be invalidated
# in the cache on abort and in other connections on finish.
self
.
_modified
=
[]
self
.
_modified
=
[]
# List of all objects (not oids) registered as modified by the
# persistence machinery.
self
.
_registered_objects
=
[]
# Do we need to join a txn manager?
self
.
_needs_to_join
=
True
# _invalidated queues invalidate messages delivered from the DB
# _invalidated queues invalidate messages delivered from the DB
# _inv_lock prevents one thread from modifying the set while
# _inv_lock prevents one thread from modifying the set while
...
...
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