#10958 closed (fixed)
Autocommit setting never sets isolation_level of connection to 0
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Keywords: | ||
Cc: | richard.davies@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Using the latest django code from subversion (revision 10645), when I have autocommit set to True in my settings.py, it looks like the isolation_level of the connection is never being set to 0. 3460_r10645-autocommit.diff patch seems to fix the problem, but I don't know if it's the right way to fix it.
Attachments (1)
Change History (6)
by , 16 years ago
Attachment: | 3460_r10645-autocommit.diff added |
---|
comment:1 by , 16 years ago
Cc: | added |
---|---|
Component: | Uncategorized → Database layer (models, ORM) |
Has patch: | set |
milestone: | → 1.1 |
comment:2 by , 16 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
looks sane. Test suite passed with autocommit enabled (postgres 8.3). Would be nice to have a buildbot that checks autocommit mode since it probably won't get much testing attention.
comment:3 by , 16 years ago
Triage Stage: | Ready for checkin → Accepted |
---|
I'm not sure this is RFC; I want to look closer first.
comment:4 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I believe this is correct - the problem is that the call to "self.connection._set_isolation_level(int(not autocommit))" in "DatabaseWrapper._init_()" is made before "self.connection" exists.
An alternative approach might be to move this entire call from "DatabaseWrapper._init_()" to the location highlighted in this patch.
Looking historically, this appears to have got broken when #3460 was applied, between the final patch on the ticket (http://code.djangoproject.com/attachment/ticket/3460/3640_r9736-autocommit-safe.diff) and the commit r10029.
The autocommit feature is in the Version1.1Features list, and is fundamentally broken without this fix, so I'm tagging this ticket to 1.1.