#2304: [patch] DISABLE_TRANSACTION_MANAGEMENT is not working as described in Doc's
--------------------------------------------------------+-------------------
Reporter:
scott.be...@openmercury.com | Owner: nobody
Status: new | Milestone:
Component: Database layer (models, ORM) | Version:
Resolution: | Keywords: Unit of work, commit, rollback, transactions
Stage: Accepted | Has_patch: 1
Needs_docs: 0 | Needs_tests: 1
Needs_better_patch: 1 |
--------------------------------------------------------+-------------------
Changes (by kmtracey):
* needs_better_patch: 0 => 1
Comment:
The existing patch is not the correct solution.
Per Jacob's response in this thread:
http://groups.google.com/group
/django-developers/browse_thread/thread/b633d56fdc7d4107/
the problem is not that the function isn't implemented, but rather that
that docs and code do not agree on the name for the setting that controls
the function. The code uses a setting named TRANSACTIONS_MANAGED (default
value False in django/conf/global_settings.py), not a setting named
DISABLE_TRANSACTION_MANAGEMENT. The fix, I believe, is a simple global
replace in either the code or the doc of one for the other, depending on
which one is chosen to keep.
DISABLE_TRANSACTION_MANAGEMENT is the one I would keep. It seems to more
clearly convey that a setting of True means Django will not manage
transactions. I found the actual default value for TRANSACTIONS_MANAGED
to be surprising when I checked on it, because I expected it to reflect
whether Django code was responsible for transaction management. In fact
its apparently the reverse of what I expected based just on the name (I
did not look at the code that uses it, just noted that there is in fact
code that references its value, unlike DISABLE_TRANSACTION_MANAGEMENT).
Note neither name is documented in the full list of settings, so it might
be good to add doc there as well when this is done.
--
Ticket URL: <
http://code.djangoproject.com/ticket/2304#comment:8>