Browse files

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

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

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 59d5537 commit 63046ec1eeaa186546b480da5988a0f607919377 Gabriel Hurley committed Nov 6, 2010
Showing with 9 additions and 5 deletions.
  1. +9 −5 docs/topics/db/transactions.txt
14 docs/topics/db/transactions.txt
@@ -32,23 +32,27 @@ If the view function produces an exception, Django rolls back any pending
To activate this feature, just add the ``TransactionMiddleware`` middleware to
-your ``MIDDLEWARE_CLASSES`` setting::
+your :setting:`MIDDLEWARE_CLASSES` setting::
+ 'django.middleware.cache.UpdateCacheMiddleware',
- 'django.middleware.cache.CacheMiddleware',
+ 'django.middleware.cache.FetchFromCacheMiddleware',
The order is quite important. The transaction middleware applies not only to
view functions, but also for all middleware modules that come after it. So if
you use the session middleware after the transaction middleware, session
creation will be part of the transaction.
-An exception is ``CacheMiddleware``, which is never affected. The cache
-middleware uses its own database cursor (which is mapped to its own database
-connection internally).
+The various cache middlewares are an exception:
+:class:`~django.middleware.cache.UpdateCacheMiddleware`, and
+:class:`~django.middleware.cache.FetchFromCacheMiddleware` are never affected.
+Even when using database caching, Django's cache backend uses its own
+database cursor (which is mapped to its own database connection internally).
.. _transaction-management-functions:

0 comments on commit 63046ec

Please sign in to comment.