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
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
Nicolas Wavrant
ZODB
Commits
807ba63c
Commit
807ba63c
authored
Nov 03, 2016
by
Tres Seaver
Committed by
GitHub
Nov 03, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #126 from fwong03/bugfix/typos
Fix a few typos in documentation
parents
e0a0ec36
f6cbe478
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
14 deletions
+14
-14
doc/guide/index.rst
doc/guide/index.rst
+1
-1
doc/guide/install-and-run.rst
doc/guide/install-and-run.rst
+2
-2
doc/guide/transactions-and-threading.rst
doc/guide/transactions-and-threading.rst
+8
-8
doc/guide/writing-persistent-objects.rst
doc/guide/writing-persistent-objects.rst
+2
-2
doc/tutorial.rst
doc/tutorial.rst
+1
-1
No files found.
doc/guide/index.rst
View file @
807ba63c
...
...
@@ -3,7 +3,7 @@ ZODB programming guide
======================
This guide consists of a collection of topics that should be of
interest to most developers. They're prov
u
ded in order of importance,
interest to most developers. They're prov
i
ded in order of importance,
which is also an order from least to most advanced, but they can be
read in any order.
...
...
doc/guide/install-and-run.rst
View file @
807ba63c
...
...
@@ -123,9 +123,9 @@ configuration to be reduced to a single URI and handles most cases.
Using
databases
:
connections
============================
Once
you
have
a
database
,
you
need
to
get
a
database
connection
to
t
o
Once
you
have
a
database
,
you
need
to
get
a
database
connection
to
d
o
much
of
anything
.
Connections
take
care
of
loading
and
saving
objects
and
manage
object
caches
.
Each
connection
has
it
'
s own cache
and
manage
object
caches
.
Each
connection
has
its
own
cache
[#
caches
-
are
-
expensive
]
_
.
..
_getting
-
connections
:
...
...
doc/guide/transactions-and-threading.rst
View file @
807ba63c
...
...
@@ -151,7 +151,7 @@ them with the ``with`` statement directly::
When
used
as
a
context
manager
,
a
transaction
manager
explicitly
begins
a
new
transaction
,
executes
the
code
block
and
commits
the
transaction
if
there
isn
't an error and aborts it
o
f there is an
transaction
if
there
isn
't an error and aborts it
i
f there is an
error.
We used ``as trans`` above to get the transaction.
...
...
@@ -242,7 +242,7 @@ connections will get a conflict error when it tries to commit::
...
ZODB
.
POSException
.
ConflictError
:
...
If
we
executed
this
code
,
we
'd get ``ConflictError`` exception on the
If
we
executed
this
code
,
we
'd get
a
``ConflictError`` exception on the
last line. After a conflict error is raised, we'
d
need
to
abort
the
transaction
,
or
begin
a
new
one
,
at
which
point
we
'd see the data as
written by the other connection:
...
...
@@ -267,7 +267,7 @@ Retrying transactions
~~~~~~~~~~~~~~~~~~~~~
The most common way to deal with conflict errors is to catch them and
retry transactions. To do this manually
,
involves code that looks
retry transactions. To do this manually involves code that looks
something like this::
max_attempts = 3
...
...
@@ -325,12 +325,12 @@ Commonly used objects that implement conflict resolution are
buckets and ``Length`` objects provided by the `BTree
<https://pythonhosted.org/BTrees/>`_ package.
The main data structures provided by BTrees
:
BTrees and TreeSets,
The main data structures provided by BTrees
,
BTrees and TreeSets,
spread their data over multiple objects. The leaf-level objects,
called *buckets*, allow distinct keys to be updated without causing
conflicts [#usually-avoids-conflicts]_.
``Length`` objects are conflict-free counters
,
that merge changes by
``Length`` objects are conflict-free counters that merge changes by
simply accumulating changes.
.. caution::
...
...
@@ -353,7 +353,7 @@ can be broken in non-obvious ways. For example a Web API that splits
logical operations over multiple web requests, as is often done in
`REST
<https://en.wikipedia.org/wiki/Representational_state_transfer>`_
APIs, violate this rule.
APIs, violate
s
this rule.
Partial transaction error recovery using savepoints
---------------------------------------------------
...
...
@@ -395,7 +395,7 @@ ZODB supports concurrency through transactions. Multiple programs
[#
wtf
-
program
]
_
can
operate
independently
in
separate
transactions
.
They
synchronize
at
transaction
boundaries
.
The
most
common
way
to
run
ZODB
is
with
each
program
running
in
it
'
s
The
most
common
way
to
run
ZODB
is
with
each
program
running
in
its
own
thread
.
Usually
the
thread
-
local
transaction
manager
is
used
.
You
can
use
multiple
threads
per
transaction
and
you
can
run
multiple
...
...
@@ -441,7 +441,7 @@ Some things to keep in mind when utilizing multiple processes:
split due to added objects causing them to exceed their maximum size.
.. [#undo] Transactions can'
t
be
rolled
back
,
but
they
may
be
undone
in some cases, especially
o
f subsequent transactions
in
some
cases
,
especially
i
f
subsequent
transactions
haven
't modified the same objects.
.. [#bad-idea-using-multiple-threads-per-transaction] While it'
s
...
...
doc/guide/writing-persistent-objects.rst
View file @
807ba63c
...
...
@@ -530,7 +530,7 @@ to store the value. Later they are used to look it up via ``in`` or
``
__getitem__
``.
When
that
``
dict
``
is
later
loaded
from
the
database
,
the
internal
storage
is
rebuil
d
from
scratch
.
This
means
that
every
key
has
its
storage
is
rebuil
t
from
scratch
.
This
means
that
every
key
has
its
``
__hash__
``
method
called
at
least
once
,
and
may
have
its
``
__eq__
``
method
called
many
times
.
...
...
@@ -538,7 +538,7 @@ By default, every object, including persistent objects, inherits an
implementation
of
``
__eq__
``
and
``
__hash__
``
from
:
class
:`
object
`.
These
default
implementations
are
based
on
the
object
's *identity*,
that is, its unique identifier within the current Python process.
Calling
, them, therefore
is very fast, even on :ref:`ghosts
Calling
them, therefore,
is very fast, even on :ref:`ghosts
<ghost-label>`, and doesn'
t
cause
a
ghost
to
load
its
state
.
If
you
override
``
__eq__
``
and
``
__hash__
``
in
a
custom
persistent
...
...
doc/tutorial.rst
View file @
807ba63c
...
...
@@ -201,7 +201,7 @@ Memory Management
ZODB manages moving objects in and out of memory for you. The unit of
storage is the persistent object. When you access attributes of a
persistent object
s, it's
loaded from the database automatically, if
persistent object
, they are
loaded from the database automatically, if
necessary. If too many objects are in memory, then objects used least
recently are evicted [#eviction]_. The maximum number of objects or
bytes in memory is configurable.
...
...
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