Loading django/db/backends/__init__.py +6 −0 Original line number Diff line number Diff line Loading @@ -170,6 +170,8 @@ class BaseDatabaseWrapper(object): self.validate_no_atomic_block() self._commit() self.set_clean() # A successful commit means that the database connection works. self.errors_occurred = False def rollback(self): """ Loading @@ -179,6 +181,8 @@ class BaseDatabaseWrapper(object): self.validate_no_atomic_block() self._rollback() self.set_clean() # A successful rollback means that the database connection works. self.errors_occurred = False def close(self): """ Loading Loading @@ -475,6 +479,8 @@ class BaseDatabaseWrapper(object): self.close() return # If an exception other than DataError or IntegrityError occurred # since the last commit / rollback, check if the connection works. if self.errors_occurred: if self.is_usable(): self.errors_occurred = False Loading Loading
django/db/backends/__init__.py +6 −0 Original line number Diff line number Diff line Loading @@ -170,6 +170,8 @@ class BaseDatabaseWrapper(object): self.validate_no_atomic_block() self._commit() self.set_clean() # A successful commit means that the database connection works. self.errors_occurred = False def rollback(self): """ Loading @@ -179,6 +181,8 @@ class BaseDatabaseWrapper(object): self.validate_no_atomic_block() self._rollback() self.set_clean() # A successful rollback means that the database connection works. self.errors_occurred = False def close(self): """ Loading Loading @@ -475,6 +479,8 @@ class BaseDatabaseWrapper(object): self.close() return # If an exception other than DataError or IntegrityError occurred # since the last commit / rollback, check if the connection works. if self.errors_occurred: if self.is_usable(): self.errors_occurred = False Loading