Преглед изворни кода

Correct scoping of savepoint example

David Cramer пре 10 година
родитељ
комит
27f68f8659
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      docs/topics/db/transactions.txt

+ 1 - 1
docs/topics/db/transactions.txt

@@ -492,8 +492,8 @@ you can roll back the single offending operation, rather than the entire
 transaction. For example::
 
     a.save() # Succeeds, and never undone by savepoint rollback
+    sid = transaction.savepoint()
     try:
-        sid = transaction.savepoint()
         b.save() # Could throw exception
         transaction.savepoint_commit(sid)
     except IntegrityError: