#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)
Change History (7)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
True - the PostgreSQL specific documentation isn't correct.
comment:3 by , 13 years ago
| Owner: | changed from to |
|---|
by , 13 years ago
| Attachment: | ticket18223.diff added |
|---|
Hi, I replaced the wrong sentence with the right one.
comment:4 by , 13 years ago
| Has patch: | set |
|---|
comment:5 by , 13 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
It looks like the first case is what happens if you have TransactionMiddleware enabled -- but it's not on by default.