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
130c9dbc
Commit
130c9dbc
authored
Sep 27, 2016
by
Frances Wong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed typos in the Transactions and Threading page.
parent
8a61d748
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
doc/guide/transactions-and-threading.rst
doc/guide/transactions-and-threading.rst
+8
-8
No files found.
doc/guide/transactions-and-threading.rst
View file @
130c9dbc
...
@@ -151,7 +151,7 @@ them with the ``with`` statement directly::
...
@@ -151,7 +151,7 @@ them with the ``with`` statement directly::
When
used
as
a
context
manager
,
a
transaction
manager
explicitly
When
used
as
a
context
manager
,
a
transaction
manager
explicitly
begins
a
new
transaction
,
executes
the
code
block
and
commits
the
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.
error.
We used ``as trans`` above to get the transaction.
We used ``as trans`` above to get the transaction.
...
@@ -242,7 +242,7 @@ connections will get a conflict error when it tries to commit::
...
@@ -242,7 +242,7 @@ connections will get a conflict error when it tries to commit::
...
...
ZODB
.
POSException
.
ConflictError
:
...
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
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
transaction
,
or
begin
a
new
one
,
at
which
point
we
'd see the data as
written by the other connection:
written by the other connection:
...
@@ -267,7 +267,7 @@ Retrying transactions
...
@@ -267,7 +267,7 @@ Retrying transactions
~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~
The most common way to deal with conflict errors is to catch them and
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::
something like this::
max_attempts = 3
max_attempts = 3
...
@@ -325,12 +325,12 @@ Commonly used objects that implement conflict resolution are
...
@@ -325,12 +325,12 @@ Commonly used objects that implement conflict resolution are
buckets and ``Length`` objects provided by the `BTree
buckets and ``Length`` objects provided by the `BTree
<https://pythonhosted.org/BTrees/>`_ package.
<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,
spread their data over multiple objects. The leaf-level objects,
called *buckets*, allow distinct keys to be updated without causing
called *buckets*, allow distinct keys to be updated without causing
conflicts [#usually-avoids-conflicts]_.
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.
simply accumulating changes.
.. caution::
.. caution::
...
@@ -353,7 +353,7 @@ can be broken in non-obvious ways. For example a Web API that splits
...
@@ -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
logical operations over multiple web requests, as is often done in
`REST
`REST
<https://en.wikipedia.org/wiki/Representational_state_transfer>`_
<https://en.wikipedia.org/wiki/Representational_state_transfer>`_
APIs, violate this rule.
APIs, violate
s
this rule.
Partial transaction error recovery using savepoints
Partial transaction error recovery using savepoints
---------------------------------------------------
---------------------------------------------------
...
@@ -395,7 +395,7 @@ ZODB supports concurrency through transactions. Multiple programs
...
@@ -395,7 +395,7 @@ ZODB supports concurrency through transactions. Multiple programs
[#
wtf
-
program
]
_
can
operate
independently
in
separate
transactions
.
[#
wtf
-
program
]
_
can
operate
independently
in
separate
transactions
.
They
synchronize
at
transaction
boundaries
.
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
.
own
thread
.
Usually
the
thread
-
local
transaction
manager
is
used
.
You
can
use
multiple
threads
per
transaction
and
you
can
run
multiple
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:
...
@@ -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.
split due to added objects causing them to exceed their maximum size.
.. [#undo] Transactions can'
t
be
rolled
back
,
but
they
may
be
undone
.. [#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.
haven
't modified the same objects.
.. [#bad-idea-using-multiple-threads-per-transaction] While it'
s
.. [#bad-idea-using-multiple-threads-per-transaction] While it'
s
...
...
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