Commit d19cb413 authored by Jim Fulton's avatar Jim Fulton

more fixes based on review comments

parent b4ad9d5a
...@@ -166,10 +166,10 @@ block as a transaction:: ...@@ -166,10 +166,10 @@ block as a transaction::
>>> exec(src) >>> exec(src)
This opens a connection, assignes it it's own context manager, and This opens a connection, assignes it its own context manager, and
executes the nested code in a transaction. We used ``as conn2`` to executes the nested code in a transaction. We used ``as conn2`` to
get the connection. The transaction boundaries are defined ``with`` get the connection. The transaction boundaries are defined by the
statement. ``with`` statement.
Getting a connection's transaction manager Getting a connection's transaction manager
------------------------------------------ ------------------------------------------
...@@ -272,7 +272,7 @@ something like this:: ...@@ -272,7 +272,7 @@ something like this::
max_attempts = 3 max_attempts = 3
attempts = 0 attempts = 0
while 1: while True:
try: try:
with transaction.manager: with transaction.manager:
... code that updates a database ... code that updates a database
...@@ -311,7 +311,7 @@ transient errors. ...@@ -311,7 +311,7 @@ transient errors.
For applications like queue workers or `cron jobs For applications like queue workers or `cron jobs
<https://en.wikipedia.org/wiki/Cron>`_, conflicts can sometimes be <https://en.wikipedia.org/wiki/Cron>`_, conflicts can sometimes be
allowed to fail, letting other queue workers or subsequent cron-job allowed to fail, letting other queue workers or subsequent cron-job
runs retry the work, runs retry the work.
Conflict resolution Conflict resolution
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment