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
12b52a71
Commit
12b52a71
authored
Jan 16, 2020
by
Jens W. Klein
Committed by
GitHub
Jan 16, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #293 from zopefoundation/doc-292-volatile-attributes
fix #292 improve volatile attribute documentation
parents
8e97bd7d
b4353ac6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
CHANGES.rst
CHANGES.rst
+2
-0
doc/guide/writing-persistent-objects.rst
doc/guide/writing-persistent-objects.rst
+13
-7
No files found.
CHANGES.rst
View file @
12b52a71
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
5.6.0 (unreleased)
5.6.0 (unreleased)
==================
==================
- Improve volatile attribute ``_v_`` documentation.
- Make repozo's recover mode atomic by recovering the backup in a
- Make repozo's recover mode atomic by recovering the backup in a
temporary file which is then moved to the expected output file.
temporary file which is then moved to the expected output file.
...
...
doc/guide/writing-persistent-objects.rst
View file @
12b52a71
...
@@ -264,18 +264,24 @@ _p_jar
...
@@ -264,18 +264,24 @@ _p_jar
commonly used by database-aware application code to get hold of an
commonly used by database-aware application code to get hold of an
object'
s
database
connection
.
object'
s
database
connection
.
Attributes
with
names
starting
with
``
_v_
``
are
treated
as
volatile
.
They
aren
't saved to the database. They'
re
useful
for
caching
data
that
can
be
computed
from
saved
data
and
shouldn
't be saved [#cache]_.
They should be treated as though they can disappear between
transactions. Setting a volatile attribute doesn'
t
cause
an
object
to
be
considered
to
be
modified
.
An
object
's ``__dict__`` attribute is treated specially in that
An
object
's ``__dict__`` attribute is treated specially in that
getting it doesn'
t
cause
an
object
's state to be loaded. It may have
getting it doesn'
t
cause
an
object
's state to be loaded. It may have
the value ``None`` rather than a dictionary for :ref:`ghosts
the value ``None`` rather than a dictionary for :ref:`ghosts
<ghost-label>`.
<ghost-label>`.
Volatile Attributes
-------------------
Attributes with names starting with ``_v_`` are volatile,
they are never serialized and not saved to the database.
They are useful for caching data that can be computed from other data[#cache]_.
Volatile attributes are local to a specific active object in memory and
thus to a specific connection. If an object is removed from the connection
cache the volatile attribute is lost.
Setting a volatile attribute does not cause an object to be considered to
be modified.
Object storage and management
Object storage and management
=============================
=============================
...
...
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