- 13 Mar, 2013 4 kayıt (commit)
-
-
Aymeric Augustin yazdı
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.
-
Anssi Kääriäinen yazdı
-
Claude Paroz yazdı
Thanks chikiro.spam at gmail.com for the report.
-
Anssi Kääriäinen yazdı
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.
-
- 12 Mar, 2013 6 kayıt (commit)
-
-
Anssi Kääriäinen yazdı
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.
-
Aymeric Augustin yazdı
-
Tim Graham yazdı
Thanks itsallvoodoo for the patch.
-
Aymeric Augustin yazdı
Thanks Anssi for the report.
-
Aymeric Augustin yazdı
One of these functions didn't exist anymore.
-
Ramiro Morales yazdı
-
- 11 Mar, 2013 30 kayıt (commit)
-
-
Aymeric Augustin yazdı
Regression in d0561242.
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
Thanks Florian for tracing the error.
-
Simon Charette yazdı
Also removed some unused imports.
-
Aymeric Augustin yazdı
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.
-
Jacob Kaplan-Moss yazdı
-
Jacob Kaplan-Moss yazdı
-
Jacob Kaplan-Moss yazdı
-
Aymeric Augustin yazdı
Refs #9437.
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
-
Claude Paroz yazdı
Tests that require USE_I18N, LOGIN_URL or certain MIDDLEWARE_CLASSES should be decorated appropriately.
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
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".
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
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.
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
Since unmanaged == autocommit, there's nothing to commit or roll back.
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
There isn't much else to say, really.
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
Apparently django.db.transaction used to be an object.
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
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.
-
Aymeric Augustin yazdı
It disables transaction management entirely when AUTOCOMMIT is False.
-