Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#10958 closed (fixed)

Autocommit setting never sets isolation_level of connection to 0

Reported by: kmishler@… 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)

3460_r10645-autocommit.diff (676 bytes ) - added by anonymous 15 years ago.

Download all attachments as: .zip

Change History (6)

by anonymous, 15 years ago

Attachment: 3460_r10645-autocommit.diff added

comment:1 by Richard Davies <richard.davies@…>, 15 years ago

Cc: richard.davies@… added
Component: UncategorizedDatabase layer (models, ORM)
Has patch: set
milestone: 1.1

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.

comment:2 by Michael Radziej, 15 years ago

Triage Stage: UnreviewedReady 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 Jacob, 15 years ago

Triage Stage: Ready for checkinAccepted

I'm not sure this is RFC; I want to look closer first.

comment:4 by Russell Keith-Magee, 15 years ago

Resolution: fixed
Status: newclosed

(In [10728]) Fixed #10958 -- Corrected the setting of PostgreSQL isolation level. Thanks to kmishler for the report.

comment:5 by Jacob, 13 years ago

milestone: 1.1

Milestone 1.1 deleted

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