Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #14624 -- Updated a few outdated references to CacheMiddleware …

…in the transactions topic guide. Thanks to quinode for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14470 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 63046ec1eeaa186546b480da5988a0f607919377 1 parent 59d5537
authored November 06, 2010

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

  1. 14  docs/topics/db/transactions.txt
14  docs/topics/db/transactions.txt
@@ -32,13 +32,14 @@ If the view function produces an exception, Django rolls back any pending
32 32
 transactions.
33 33
 
34 34
 To activate this feature, just add the ``TransactionMiddleware`` middleware to
35  
-your ``MIDDLEWARE_CLASSES`` setting::
  35
+your :setting:`MIDDLEWARE_CLASSES` setting::
36 36
 
37 37
     MIDDLEWARE_CLASSES = (
  38
+        'django.middleware.cache.UpdateCacheMiddleware',
38 39
         'django.contrib.sessions.middleware.SessionMiddleware',
39 40
         'django.middleware.common.CommonMiddleware',
40  
-        'django.middleware.cache.CacheMiddleware',
41 41
         'django.middleware.transaction.TransactionMiddleware',
  42
+        'django.middleware.cache.FetchFromCacheMiddleware',
42 43
     )
43 44
 
44 45
 The order is quite important. The transaction middleware applies not only to
@@ -46,9 +47,12 @@ view functions, but also for all middleware modules that come after it. So if
46 47
 you use the session middleware after the transaction middleware, session
47 48
 creation will be part of the transaction.
48 49
 
49  
-An exception is ``CacheMiddleware``, which is never affected. The cache
50  
-middleware uses its own database cursor (which is mapped to its own database
51  
-connection internally).
  50
+The various cache middlewares are an exception:
  51
+:class:`~django.middleware.cache.CacheMiddleware`,
  52
+:class:`~django.middleware.cache.UpdateCacheMiddleware`, and
  53
+:class:`~django.middleware.cache.FetchFromCacheMiddleware` are never affected.
  54
+Even when using database caching, Django's cache backend uses its own
  55
+database cursor (which is mapped to its own database connection internally).
52 56
 
53 57
 .. _transaction-management-functions:
54 58
 

0 notes on commit 63046ec

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