Opened 6 years ago

Closed 6 years ago

Last modified 4 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: master
Severity: Keywords:
Cc: richard.davies@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Using the latest django code from subversion (revision 10645), when I have autocommit set to True in my, 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 6 years ago.

Download all attachments as: .zip

Change History (6)

Changed 6 years ago by anonymous

comment:1 Changed 6 years ago by Richard Davies <richard.davies@…>

  • Cc richard.davies@… added
  • Component changed from Uncategorized to Database layer (models, ORM)
  • Has patch set
  • milestone set to 1.1
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 ( 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 Changed 6 years ago by mir

  • Triage Stage changed from Unreviewed to 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 Changed 6 years ago by jacob

  • Triage Stage changed from Ready for checkin to Accepted

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

comment:4 Changed 6 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:5 Changed 4 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

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