Ticket #16047: 3-properly-maintain-autocommit.patch

File 3-properly-maintain-autocommit.patch, 940 bytes (added by Brodie Rao, 13 years ago)
  • django/db/backends/postgresql_psycopg2/base.py

    # HG changeset patch
    # User Brodie Rao <brodie@bitheap.org>
    # Date 1305680869 25200
    # Branch releases/1.3.X
    # Node ID 20e21be6d90c3376c59bca6dbf5e01690a417289
    # Parent  449a8f9da389a7a6642d8bb2c98825df8a02c90e
    psycopg2: properly restore autocommit mode when leaving transaction management
    
    diff --git a/django/db/backends/postgresql_psycopg2/base.py b/django/db/backends/postgresql_psycopg2/base.py
    a b class DatabaseWrapper(BaseDatabaseWrappe  
    177177        If the normal operating mode is "autocommit", switch back to that when
    178178        leaving transaction management.
    179179        """
    180         if self.features.uses_autocommit and not managed and self.isolation_level:
     180        if self.features.uses_autocommit and self.isolation_level:
    181181            self._set_isolation_level(0)
    182182
    183183    def _set_isolation_level(self, level):
Back to Top