diff options
| author | Tim Graham <timograham@gmail.com> | 2012-11-06 08:53:10 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2012-11-06 17:50:00 -0500 |
| commit | 84e33545c90f353eacf8d01b33d9bec635f4e2c0 (patch) | |
| tree | 4d8d1dccb23500308094f6804b7471d2ffaa91cb /docs | |
| parent | e645c89bbbcf62479441e50b5e5fdf48a80d424f (diff) | |
[1.5.X] Fixed #19154 - Noted commit_manually requires commit/rollback for reads
Thanks als for the report.
Backport of 620e0bba49 from master
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/topics/db/transactions.txt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/docs/topics/db/transactions.txt b/docs/topics/db/transactions.txt index 4a52c5af35..3c0ec4f187 100644 --- a/docs/topics/db/transactions.txt +++ b/docs/topics/db/transactions.txt @@ -161,8 +161,12 @@ managers, too. transactions. It tells Django you'll be managing the transaction on your own. - If your view changes data and doesn't ``commit()`` or ``rollback()``, - Django will raise a ``TransactionManagementError`` exception. + Whether you are writing or simply reading from the database, you must + ``commit()`` or ``rollback()`` explicitly or Django will raise a + :exc:`TransactionManagementError` exception. This is required when reading + from the database because ``SELECT`` statements may call functions which + modify tables, and thus it is impossible to know if any data has been + modified. Manual transaction management looks like this:: |
