Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#18223 closed Uncategorized (fixed)

Database commit behavior is confusingly documented

Reported by: philipn Owned by: mateusgondim
Component: Documentation Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Reading https://docs.djangoproject.com/en/dev/ref/databases/:

Transaction handling

By default, Django starts a transaction when a database connection is first used and commits the result at the end of the request/response handling. The PostgreSQL backends normally operate the same as any other Django backend in this respect.

Then reading https://docs.djangoproject.com/en/dev/topics/db/transactions/:

Django’s default behavior is to run with an open transaction which it commits automatically when any built-in, data-altering model function is called. For example, if you call model.save() or model.delete(), the change will be committed immediately.


https://docs.djangoproject.com/en/dev/topics/db/transactions/ describes the current behavior. It seems like the other documentation should be updated to reflect this.

Attachments (1)

ticket18223.diff (855 bytes ) - added by mateusgondim 12 years ago.
Hi, I replaced the wrong sentence with the right one.

Download all attachments as: .zip

Change History (7)

comment:1 by philipn, 13 years ago

It looks like the first case is what happens if you have TransactionMiddleware enabled -- but it's not on by default.

comment:2 by Anssi Kääriäinen, 13 years ago

Triage Stage: UnreviewedAccepted

True - the PostgreSQL specific documentation isn't correct.

comment:3 by mateusgondim, 12 years ago

Owner: changed from nobody to mateusgondim

by mateusgondim, 12 years ago

Attachment: ticket18223.diff added

Hi, I replaced the wrong sentence with the right one.

comment:4 by mateusgondim, 12 years ago

Has patch: set

comment:5 by Tim Graham <timograham@…>, 12 years ago

Resolution: fixed
Status: newclosed

In [2079b730f139685bcedf0c92d5ed9a3f64b51e9f]:

Fixed #18223 - Corrected default transaction behavior in postgresql docs.

Thanks philipn for the report and mateusgondim for the patch.

comment:6 by Tim Graham <timograham@…>, 12 years ago

In [01b02317172a5030b77a09aada11657c00398416]:

[1.4.X] Fixed #18223 - Corrected default transaction behavior in postgresql docs.

Thanks philipn for the report and mateusgondim for the patch.

Backport of 2079b730f1 from master

Note: See TracTickets for help on using tickets.
Back to Top