Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Updated the documentation for savepoints.

Apparently django.db.transaction used to be an object.
  • Loading branch information...
commit ffe41591e75fc3acf76c634bdd0899d78e91688d 1 parent 557e404
Aymeric Augustin authored March 07, 2013

Showing 1 changed file with 17 additions and 9 deletions. Show diff stats Hide diff stats

  1. 26  docs/topics/db/transactions.txt
26  docs/topics/db/transactions.txt
@@ -193,24 +193,32 @@ Each of these functions takes a ``using`` argument which should be the name of
193 193
 a database for which the behavior applies.  If no ``using`` argument is
194 194
 provided then the ``"default"`` database is used.
195 195
 
196  
-Savepoints are controlled by three methods on the transaction object:
  196
+Savepoints are controlled by three functions in :mod:`django.db.transaction`:
197 197
 
198  
-.. method:: transaction.savepoint(using=None)
  198
+.. function:: savepoint(using=None)
199 199
 
200 200
     Creates a new savepoint. This marks a point in the transaction that
201 201
     is known to be in a "good" state.
202 202
 
203  
-    Returns the savepoint ID (sid).
  203
+    Returns the savepoint ID (``sid``).
204 204
 
205  
-.. method:: transaction.savepoint_commit(sid, using=None)
  205
+.. function:: savepoint_commit(sid, using=None)
206 206
 
207  
-    Updates the savepoint to include any operations that have been performed
208  
-    since the savepoint was created, or since the last commit.
  207
+    Releases savepoint ``sid``. The changes performed since the savepoint was
  208
+    created become part of the transaction.
209 209
 
210  
-.. method:: transaction.savepoint_rollback(sid, using=None)
  210
+.. function:: savepoint_rollback(sid, using=None)
211 211
 
212  
-    Rolls the transaction back to the last point at which the savepoint was
213  
-    committed.
  212
+    Rolls back the transaction to savepoint ``sid``.
  213
+
  214
+These functions do nothing if savepoints aren't supported or if the database
  215
+is in autocommit mode.
  216
+
  217
+In addition, there's a utility function:
  218
+
  219
+.. function:: clean_savepoints(using=None)
  220
+
  221
+    Resets the counter used to generate unique savepoint IDs.
214 222
 
215 223
 The following example demonstrates the use of savepoints::
216 224
 

0 notes on commit ffe4159

Please sign in to comment.
Something went wrong with that request. Please try again.