summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-03-13Proof-read and adjusted the transactions docs.Aymeric Augustin
2013-03-13Improved recovery when the connection is closed in an atomic block.Aymeric Augustin
2013-03-13Made atomic usable when autocommit is off.Aymeric Augustin
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-13Fixed failing aggregation tests on MySQLAnssi Kääriäinen
2013-03-13Fixed #20036 -- Improved GEOS version string parsingClaude Paroz
Thanks chikiro.spam at gmail.com for the report.
2013-03-13Refactored qs.add_q() and utils/tree.pyAnssi Kääriäinen
The sql/query.py add_q method did a lot of where/having tree hacking to get complex queries to work correctly. The logic was refactored so that it should be simpler to understand. The new logic should also produce leaner WHERE conditions. The changes cascade somewhat, as some other parts of Django (like add_filter() and WhereNode) expect boolean trees in certain format or they fail to work. So to fix the add_q() one must fix utils/tree.py, some things in add_filter(), WhereNode and so on. This commit also fixed add_filter to see negate clauses up the path. A query like .exclude(Q(reversefk__in=a_list)) didn't work similarly to .filter(~Q(reversefk__in=a_list)). The reason for this is that only the immediate parent negate clauses were seen by add_filter, and thus a tree like AND: (NOT AND: (AND: condition)) will not be handled correctly, as there is one intermediary AND node in the tree. The example tree is generated by .exclude(~Q(reversefk__in=a_list)). Still, aggregation lost connectors in OR cases, and F() objects and aggregates in same filter clause caused GROUP BY problems on some databases. Fixed #17600, fixed #13198, fixed #17025, fixed #17000, fixed #11293.
2013-03-12Fixed #19964 -- Removed relabel_aliases from some structsAnssi Kääriäinen
Before there was need to have both .relabel_aliases() and .clone() for many structs. Now there is only relabeled_clone() for those structs where alias is the only mutable attribute.
2013-03-12Restricted a workaround for a bug in Python to the affected versions.Aymeric Augustin
2013-03-12Fixed #19965 - Added a warning that the tutorial is written for Python 2.Tim Graham
Thanks itsallvoodoo for the patch.
2013-03-12Fixed #20028 -- Made atomic usable on callable instances.Aymeric Augustin
Thanks Anssi for the report.
2013-03-12Removed unused imports.Aymeric Augustin
One of these functions didn't exist anymore.
2013-03-11Fixed broken link in binary fields doc.Ramiro Morales
2013-03-11Fixed tests that relied on MANAGERS not being empty.Aymeric Augustin
Regression in d0561242.
2013-03-11Fixed #20026 -- Typo in Apache auth docs.Aymeric Augustin
2013-03-11Fixed a refactoring error in ba5138b1.Aymeric Augustin
Thanks Florian for tracing the error.
2013-03-11Fixed #20010 -- Make sure `last_executed_query` contains it's associated ↵Simon Charette
parameters on Oracle. Also removed some unused imports.
2013-03-11Fixed #11569 -- Wrapped DatabaseCache._base_set in an atomic block.Aymeric Augustin
The atomic block provides a clean rollback to a savepoint on failed writes. The ticket reported a race condition which I don't know how to test.
2013-03-11Merge branch 'deprecate-comments'Jacob Kaplan-Moss
2013-03-11Remove a special case for comment tests from runtests.py.Jacob Kaplan-Moss
2013-03-11Deprecated django.contrib.comments.Jacob Kaplan-Moss
2013-03-11Avoided closing the database connection within a transaction.Aymeric Augustin
Refs #9437.
2013-03-11Adjusted query counts to account for new savepoints.Aymeric Augustin
2013-03-11Ported layermapping for autocommit.Aymeric Augustin
2013-03-11Switched the admin to use @transaction.atomic.Aymeric Augustin
2013-03-11Ran a test that closes the database connection outside of a transaction.Aymeric Augustin
2013-03-11Removed forced settings in runtestsClaude Paroz
Tests that require USE_I18N, LOGIN_URL or certain MIDDLEWARE_CLASSES should be decorated appropriately.
2013-03-11Fixed loaddata command, broken in the previous merge.Aymeric Augustin
2013-03-11Merged branch 'database-level-autocommit'.Aymeric Augustin
Fixed #2227: `atomic` supports nesting. Fixed #6623: `commit_manually` is deprecated and `atomic` doesn't suffer from this defect. Fixed #8320: the problem wasn't identified, but the legacy transaction management is deprecated. Fixed #10744: the problem wasn't identified, but the legacy transaction management is deprecated. Fixed #10813: since autocommit is enabled, it isn't necessary to rollback after errors any more. Fixed #13742: savepoints are now implemented for SQLite. Fixed #13870: transaction management in long running processes isn't a problem any more, and it's documented. Fixed #14970: while it digresses on transaction management, this ticket essentially asks for autocommit on PostgreSQL. Fixed #15694: `atomic` supports nesting. Fixed #17887: autocommit makes it impossible for a connection to stay "idle of transaction".
2013-03-11Improved the API of set_autocommit.Aymeric Augustin
2013-03-11Abused atomic for transaction handling in TestCase.Aymeric Augustin
It isn't necessary to disable set_autocommit since its use is prohibited inside an atomic block. It's still necessary to disable the legacy transaction management methods for backwards compatibility, until they're removed.
2013-03-11Used commit_on_success_unless_managed in loaddata.Aymeric Augustin
2013-03-11Used commit_on_success_unless_managed to make ORM operations atomic.Aymeric Augustin
2013-03-11Removed a test that no longer makes any sense.Aymeric Augustin
Since unmanaged == autocommit, there's nothing to commit or roll back.
2013-03-11Updated a test that doesn't make sense with autocommit.Aymeric Augustin
2013-03-11Added a safety net for developers messing with autocommit.Aymeric Augustin
2013-03-11Added an option to disable the creation of savepoints in atomic.Aymeric Augustin
2013-03-11Added a note about long-running processes.Aymeric Augustin
There isn't much else to say, really.
2013-03-11Added an explanation of transactions and grouped low-level APIs.Aymeric Augustin
2013-03-11Updated the documentation for savepoints.Aymeric Augustin
Apparently django.db.transaction used to be an object.
2013-03-11Re-ordered functions by deprecation status.Aymeric Augustin
2013-03-11Deprecated TransactionMiddleware and TRANSACTIONS_MANAGED.Aymeric Augustin
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-11Implemented atomic_if_autocommit.Aymeric Augustin
It disables transaction management entirely when AUTOCOMMIT is False.
2013-03-11Made transaction management work even before the first SQL query.Aymeric Augustin
Thanks Florian again.
2013-03-11Added some assertions to enforce the atomicity of atomic.Aymeric Augustin
2013-03-11Implemented an 'atomic' decorator and context manager.Aymeric Augustin
Currently it only works in autocommit mode. Based on @xact by Christophe Pettus.
2013-03-11Added support for savepoints in SQLite.Aymeric Augustin
Technically speaking they aren't usable yet.
2013-03-11Refactored implementation of savepoints.Aymeric Augustin
Prepared for using savepoints within transactions in autocommit mode.
2013-03-11Moved standard SQL for savepoints in the base backend.Aymeric Augustin
These methods are only called when uses_savepoints = True anyway.
2013-03-11Deprecated transaction.is_managed().Aymeric Augustin
It's synchronized with the autocommit flag.
2013-03-11Deprecated transaction.commit/rollback_unless_managed.Aymeric Augustin
Since "unless managed" now means "if database-level autocommit", committing or rolling back doesn't have any effect. Restored transactional integrity in a few places that relied on automatically-started transactions with a transitory API.