Commit Graph

57 Commits

Author SHA1 Message Date
Tim Graham 51c8045145 Removed versionadded/changed annotations for 1.6. 2014-03-24 11:42:56 -04:00
Szczepan Cieślik e816198034 Fixed docs typos. 2014-02-25 10:28:32 -05:00
Aymeric Augustin 8e1fc03491 Fixed typo. Refs #21836. 2014-01-26 09:30:10 +01:00
Chris Jerdonek 798fd59fad Fixed #21836 -- Improved transaction docs about autocommit mode
Clarified that queries in autocommit mode are committed immediately
only if a transaction has not already been started. Added to the
main transaction docs that Django's TestCase class implicitly wraps
its tests in transactions.
2014-01-25 21:20:17 +01:00
Aymeric Augustin 728548e483 Fixed #21134 -- Prevented queries in broken transactions.
Squashed commit of the following:

commit 63ddb271a44df389b2c302e421fc17b7f0529755
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Sep 29 22:51:00 2013 +0200

    Clarified interactions between atomic and exceptions.

commit 2899ec299228217c876ba3aa4024e523a41c8504
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Sep 22 22:45:32 2013 +0200

    Fixed TransactionManagementError in tests.

    Previous commit introduced an additional check to prevent running
    queries in transactions that will be rolled back, which triggered a few
    failures in the tests. In practice using transaction.atomic instead of
    the low-level savepoint APIs was enough to fix the problems.

commit 4a639b059ea80aeb78f7f160a7d4b9f609b9c238
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Sep 24 22:24:17 2013 +0200

    Allowed nesting constraint_checks_disabled inside atomic.

    Since MySQL handles transactions loosely, this isn't a problem.

commit 2a4ab1cb6e83391ff7e25d08479e230ca564bfef
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sat Sep 21 18:43:12 2013 +0200

    Prevented running queries in transactions that will be rolled back.

    This avoids a counter-intuitive behavior in an edge case on databases
    with non-atomic transaction semantics.

    It prevents using savepoint_rollback() inside an atomic block without
    calling set_rollback(False) first, which is backwards-incompatible in
    tests.

    Refs #21134.

commit 8e3db393853c7ac64a445b66e57f3620a3fde7b0
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Sep 22 22:14:17 2013 +0200

    Replaced manual savepoints by atomic blocks.

    This ensures the rollback flag is handled consistently in internal APIs.
2013-09-30 09:42:27 +02:00
Aymeric Augustin 4db2752e28 Clarified why one must not catch database errors inside atomic. 2013-09-20 21:56:35 +02:00
Julien Phalip 47c755327b Fixed a number of minor misspellings. 2013-07-27 18:46:03 -07:00
Aymeric Augustin c1284c3d3c Fixed #20571 -- Added an API to control connection.needs_rollback.
This is useful:
- to force a rollback on the exit of an atomic block without having to
  raise and catch an exception;
- to prevent a rollback after handling an exception manually.
2013-06-27 22:19:54 +02:00
yishaibeeri f077f89198 Patch for ticket #20506 - documentation type 2013-05-27 11:14:38 +03:00
Aymeric Augustin 6633eeb886 Changed API to disable ATOMIC_REQUESTS per view.
A decorator is easier to apply to CBVs. Backwards compatibility isn't an
issue here, except for people running on a recent clone of master.

Fixed a few minor problems in the transactions docs while I was there.
2013-05-19 19:53:16 +02:00
Marc Tamlyn 9666874ee1 Tidy up some of the transaction documentation. 2013-05-17 18:40:50 +02:00
Ana Krivokapic cee96b87c0 Fix two typos in database transactions docs 2013-04-30 18:38:59 +02:00
Juan Catalano 78c842a323 Adapted uses of versionchanged/versionadded to the new form.
Refs #20104.
2013-04-20 17:18:35 +02:00
Ramiro Morales ccf8d81113 Fixed docs reST warning. 2013-03-25 21:56:52 -03:00
Aymeric Augustin ae417dd4d5 Added release notes for 4b31a6a9.
Thanks Florian for reporting this omission.
2013-03-24 13:13:19 +01:00
Aymeric Augustin 5d8342f321 Proof-read and adjusted the transactions docs. 2013-03-13 15:17:41 +01:00
Aymeric Augustin 83a416f5e7 Made atomic usable when autocommit is off.
Thanks Anssi for haggling until I implemented this.

This change alleviates the need for atomic_if_autocommit. When
autocommit is disabled for a database, atomic will simply create and
release savepoints, and not commit anything. This honors the contract of
not doing any transaction management.

This change also makes the hack to allow using atomic within the legacy
transaction management redundant.

None of the above will work with SQLite, because of a flaw in the design
of the sqlite3 library. This is a known limitation that cannot be lifted
without unacceptable side effects eg. triggering arbitrary commits.
2013-03-13 15:17:40 +01:00
Aymeric Augustin e654180ce2 Improved the API of set_autocommit. 2013-03-11 15:10:58 +01:00
Aymeric Augustin 4dbd1b2dd8 Used commit_on_success_unless_managed to make ORM operations atomic. 2013-03-11 15:05:05 +01:00
Aymeric Augustin 107d9b1d97 Added an option to disable the creation of savepoints in atomic. 2013-03-11 15:05:04 +01:00
Aymeric Augustin 189fb4e294 Added a note about long-running processes.
There isn't much else to say, really.
2013-03-11 15:05:04 +01:00
Aymeric Augustin 17cf29920b Added an explanation of transactions and grouped low-level APIs. 2013-03-11 15:05:02 +01:00
Aymeric Augustin ffe41591e7 Updated the documentation for savepoints.
Apparently django.db.transaction used to be an object.
2013-03-11 15:04:10 +01:00
Aymeric Augustin ac37ed21b3 Deprecated TransactionMiddleware and TRANSACTIONS_MANAGED.
Replaced them with per-database options, for proper multi-db support.

Also toned down the recommendation to tie transactions to HTTP requests.
Thanks Jeremy for sharing his experience.
2013-03-11 15:04:05 +01:00
Aymeric Augustin 7c46c8d5f2 Added some assertions to enforce the atomicity of atomic. 2013-03-11 14:48:55 +01:00
Aymeric Augustin d7bc4fbc94 Implemented an 'atomic' decorator and context manager.
Currently it only works in autocommit mode.

Based on @xact by Christophe Pettus.
2013-03-11 14:48:55 +01:00
Aymeric Augustin 4b31a6a9e6 Added support for savepoints in SQLite.
Technically speaking they aren't usable yet.
2013-03-11 14:48:55 +01:00
Aymeric Augustin 5e27debc5c Enabled database-level autocommit for all backends.
This is mostly a documentation change.

It has the same backwards-incompatibility consequences as those
described for PostgreSQL in a previous commit.
2013-03-11 14:48:54 +01:00
Aymeric Augustin f515619494 Added an API to control database-level autocommit. 2013-03-11 14:48:53 +01:00
Tim Graham 9b5f64cc6e Fixed #19516 - Fixed remaining broken links.
Added -n to sphinx builds to catch issues going forward.
2013-01-02 18:32:57 -05:00
Aymeric Augustin 7ee7599ab3 Removed versionadded/changed annotations dating back to 1.4. 2012-12-29 21:59:08 +01:00
Tim Graham 31f49f1396 Fixed #19442 - Clarified that raw SQL must be committed.
Thanks startup.canada for the suggestion.
2012-12-18 08:10:12 -05:00
Aymeric Augustin a001f3c31e Fixed #2304 -- Documented TRANSACTIONS_MANAGED. 2012-12-14 21:15:48 +01:00
Tim Graham 620e0bba49 Fixed #19154 - Noted commit_manually requires commit/rollback for reads
Thanks als for the report.
2012-11-06 17:47:10 -05:00
Tim Graham 837425b425 Fixed #18934 - Removed versionadded/changed annotations for Django 1.3 2012-09-20 19:06:55 -04:00
Aymeric Augustin c13a98968e Fixed a misplaced Sphinx reference. 2012-07-14 12:32:39 +02:00
Tim Graham 5d81ad1af1 Fixed #17168 - Noted TransactionMiddleware only works with "default" database alias.
Thanks codeinthehole for the draft patch.
2012-06-30 10:25:51 -04:00
Ramiro Morales 83fc965171 Added documentation notes about lack of database savepoints support when using MySQL+MyISAM.
Refs #15507, #18116 and r17341, r17921.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17923 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-04-21 22:52:03 +00:00
Claude Paroz 23d3459761 Fixed #17965 -- Definitely dropped support for Python 2.5. Thanks jonash for the initial patch and Aymeric Augustin for the review.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17834 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-03-31 08:24:29 +00:00
Adrian Holovaty 6bbc85cd6a Edited db/transactions.txt changes from [17341]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17423 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-03 17:54:08 +00:00
Ramiro Morales 8312b85c97 Added support for savepoints to the MySQL DB backend.
MySQL provides the savepoint functionality starting with version 5.0.3
when using the MyISAM storage engine.

Thanks lamby for the report and patch.

Fixes #15507.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17341 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-05 00:45:31 +00:00
Luke Plant d1e5c55258 Fixed many more ReST indentation errors, somehow accidentally missed from [16955]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16983 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-14 00:12:01 +00:00
Ramiro Morales dff31de20a Fixed #16155 -- Removed Python 2.4 compatibility constructs from code and mentions from docs. Thanks Aymeric Augustin for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16349 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-09 20:01:28 +00:00
Simon Meers 5ecb88c146 Fixed #16014 -- numerous documentation typos -- thanks psmith.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16220 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-13 04:33:42 +00:00
Timo Graham d665c0b3b9 Fixed #15664 - Removed extra parens in commit_on_success example.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15923 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-27 23:00:36 +00:00
Gabriel Hurley a4ef094b0f Corrected a number of mislinked crossrefs and added a few new crossref targets found in/via the 1.3 release.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15894 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-22 20:12:17 +00:00
Russell Keith-Magee 6314a1b42e Fixed #9964 -- Ensure that all database operations make transactions dirty, not just write operations. Many thanks to Shai Berger for his work and persistence on this issue.
This is BACKWARDS INCOMPATIBLE for anyone relying on the current behavior that allows manually managed read-only transactions to be left dangling without a manual commit or rollback.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15493 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-12 13:03:34 +00:00
Timo Graham 2ea93f9327 Fixed #14000 - remove versionadded/changed tags for Django 1.0 and 1.1
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15055 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-26 00:37:14 +00:00
Gabriel Hurley 63046ec1ee 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
2010-11-06 09:19:53 +00:00
Alex Gaynor 27db9378cf Fixed #10771 -- added support for using the transaction management functions as context managers in Python 2.5 and above. Thanks to Jacob for help with the docs.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14288 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-19 19:38:15 +00:00