Merge pull request #3763 from dcramer/patch-2
Correct scoping of savepoint example
This commit is contained in:
commit
653a3a4e18
|
@ -492,8 +492,8 @@ you can roll back the single offending operation, rather than the entire
|
||||||
transaction. For example::
|
transaction. For example::
|
||||||
|
|
||||||
a.save() # Succeeds, and never undone by savepoint rollback
|
a.save() # Succeeds, and never undone by savepoint rollback
|
||||||
try:
|
|
||||||
sid = transaction.savepoint()
|
sid = transaction.savepoint()
|
||||||
|
try:
|
||||||
b.save() # Could throw exception
|
b.save() # Could throw exception
|
||||||
transaction.savepoint_commit(sid)
|
transaction.savepoint_commit(sid)
|
||||||
except IntegrityError:
|
except IntegrityError:
|
||||||
|
|
Loading…
Reference in New Issue