Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#21836 closed Cleanup/optimization (fixed)

clarify behavior of autocommit mode in presence of transaction

Reported by: Chris Jerdonek Owned by: Aymeric Augustin
Component: Documentation Version: 1.6
Severity: Normal Keywords: autocommit, transactions, database
Cc: chris.jerdonek@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As someone relatively new to Django, in reading the Database transactions section of the Django docs, I thought a couple things could be clarified or improved.

Namely, it would be helpful to clarify that both (1) the default "autocommit" behavior of immediately committing doesn't occur if a transaction has already been started, and (2) Django's main TestCase class implicitly starts a transaction (thus "suspending" the default autocommit behavior). Not mentioning the latter in the main transaction docs contributed to my running into documentation issue #21540, so I think resolving this issue will help address issue #21540.

I've already written up a proposed patch with suggested wording for the above. I will post it to this issue shortly. Thanks.

Change History (9)

comment:1 by Chris Jerdonek, 11 years ago

Cc: chris.jerdonek@… added
Owner: changed from nobody to Chris Jerdonek
Status: newassigned

comment:2 by Chris Jerdonek, 11 years ago

Type: UncategorizedCleanup/optimization

comment:3 by Chris Jerdonek, 11 years ago

Has patch: set

I made pull request 2191 for this.

comment:4 by Aymeric Augustin, 11 years ago

Owner: changed from Chris Jerdonek to Aymeric Augustin

comment:5 by Tim Graham, 11 years ago

Triage Stage: UnreviewedReady for checkin

(leaving open for Aymeric to take a look)

comment:6 by Aymeric Augustin, 11 years ago

The suggestions is legitimate but I believe the patch was less precise than the original in several sentences. I'll commit a slightly edited version.

Version 0, edited 11 years ago by Aymeric Augustin (next)

comment:7 by Aymeric Augustin <aymeric.augustin@…>, 11 years ago

Resolution: fixed
Status: assignedclosed

In 798fd59fad241ca8e48ba2a4526935b92736d30d:

Fixed #21836 -- Improved transaction docs about autocommit mode

Clarified that queries in autocommit mode are committed immediately
only if a transaction has not already been started. Added to the
main transaction docs that Django's TestCase class implicitly wraps
its tests in transactions.

comment:8 by Aymeric Augustin <aymeric.augustin@…>, 11 years ago

In a21fc1c08667dc319601b8195d0a7d3a4b8f2af5:

[1.6.x] Fixed #21836 -- Improved transaction docs about autocommit mode

Clarified that queries in autocommit mode are committed immediately
only if a transaction has not already been started. Added to the
main transaction docs that Django's TestCase class implicitly wraps
its tests in transactions.

Backport of 798fd59f from master.

comment:9 by Aymeric Augustin <aymeric.augustin@…>, 11 years ago

In a0a6112afc08c7471b70ee5e35170dfee3b488f3:

[1.6.x] Fixed typo. Refs #21836.

Backport of 8e1fc03 from master

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